forked from andkok/MWS_2021
32 lines
659 B
C#
32 lines
659 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
[CustomEditor(typeof(TurtleLSystem),true)]
|
|
public class TurtleEditor : Editor
|
|
{
|
|
TurtleLSystem turtleLSystem;
|
|
|
|
|
|
public override void OnInspectorGUI() {
|
|
DrawDefaultInspector();
|
|
|
|
if (GUILayout.Button("Load file")) {
|
|
turtleLSystem.loadFile();
|
|
}
|
|
|
|
if (GUILayout.Button("Evaluate")) {
|
|
turtleLSystem.evaluateAndPresent();
|
|
}
|
|
|
|
}
|
|
void OnEnable() {
|
|
turtleLSystem = (TurtleLSystem)target;
|
|
Tools.hidden = true;
|
|
}
|
|
|
|
void OnDisable() {
|
|
Tools.hidden = false;
|
|
}
|
|
}
|