Esempio n. 1
0
 void OnEnable()
 {
     creator = (MapCreator)target;
     if (creator.grid == null)
     {
         creator.CreateGrid();
     }
     Debug.Log(creator.transform.name);
 }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUI.BeginChangeCheck();
        if (GUILayout.Button("Create new"))
        {
            Undo.RecordObject(creator, "Create new");
            creator.CreateGrid();
        }

        if (GUILayout.Button("Create Mesh"))
        {
            Undo.RecordObject(creator, "Create new Mesh");
            creator.CreateMesh();
        }
    }