public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("Reroll Sprite"))
        {
            foreach (Object targ in targets)
            {
                ZST_SmartTile script = (ZST_SmartTile)targ;
                if (!script)
                {
                    continue;
                }

                script.RerollSprite();

                if (!Application.isPlaying)
                {
                    EditorUtility.SetDirty(script);
                }
            }
        }

        ZST_SmartTile smartSprite      = (ZST_SmartTile)target;
        string        hideOrShowPrefix = smartSprite.AreChildrenHidden() ? "Show" : "Hide";

        if (GUILayout.Button(hideOrShowPrefix + " Children"))
        {
            smartSprite.HideOrShowChildren();
        }

        if (!Application.isPlaying)
        {
            EditorSceneManager.MarkSceneDirty(UnityEngine.SceneManagement.SceneManager.GetActiveScene());
        }
    }
Example #2
0
 public void RemoveTile(ZST_SmartTile tile)
 {
     tiles.Remove(tile);
 }
Example #3
0
 public void AddTile(ZST_SmartTile tile)
 {
     tiles.Add(tile);
 }