33 lines
617 B
C#
33 lines
617 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
[CustomEditor(typeof(TreeTurtle), true)]
|
|
public class TurtleEditor : Editor
|
|
{
|
|
TreeTurtle turtleLSystem;
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
DrawDefaultInspector();
|
|
|
|
if (GUILayout.Button("Load file"))
|
|
{
|
|
turtleLSystem.loadFile();
|
|
}
|
|
|
|
if (GUILayout.Button("Evaluate"))
|
|
{
|
|
turtleLSystem.evaluateAndPresent();
|
|
}
|
|
|
|
}
|
|
void OnEnable()
|
|
{
|
|
turtleLSystem = (TreeTurtle)target;
|
|
Tools.hidden = true;
|
|
}
|
|
|
|
void OnDisable()
|
|
{
|
|
Tools.hidden = false;
|
|
}
|
|
} |