Skip to content

Instantly share code, notes, and snippets.

@uzzu
Last active December 17, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzzu/5596773 to your computer and use it in GitHub Desktop.
Save uzzu/5596773 to your computer and use it in GitHub Desktop.
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);
}
}
}
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