Last active
December 17, 2015 10:39
-
-
Save uzzu/5596773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Hoge : MonoBehaviour | |
{ | |
public List<Vector3> Points; | |
// Use this for initialization | |
void Start() | |
{ | |
Verbose(); | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
} | |
public void Verbose() | |
{ | |
foreach (Vector3 point in this.Points) | |
{ | |
Debug.Log(point); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
[CustomEditor(typeof(Hoge))] | |
public class HogeEditor : Editor | |
{ | |
Hoge Source; | |
int ChildCount; | |
bool ShowPoints; | |
void OnEnable() | |
{ | |
this.Source = (Hoge) base.target; | |
} | |
// Use this for initialization | |
void OnInspectorGUI() | |
{ | |
/* | |
// does not work...? how to print? | |
this.ChildCount = this.Source.gameObject.transform.GetChildCount(); | |
this.ShowPoints = EditorGUILayout.Foldout(this.ShowPoints, "points"); | |
EditorGUI.indentLevel++; | |
for (var i = 0 ; i < this.ChildCount; i++) | |
{ | |
var child = this.Source.gameObject.transform.GetChild(i); | |
this.Source.Points[i] = EditorGUILayout.Vector3Field("point" + i, child.position); | |
} | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment