/// <summary>
        /// Called each time the object is selected
        /// </summary>
        void OnEnable()
        {
            //assign event for selecting a paletteItem

            PaletteWindow.PaletteItemSelectedEvent +=
                new PaletteWindow.paletteItemSelectedDelegate(UpdateCurrentPieceInstance);
            //target is a Editor "gameobject", the object being inspected.

            //esplicitly cast to target.
            targetLevel   = (Level)target;
            oldRowSize    = targetLevel.TotalRows;
            oldColumnSize = targetLevel.TotalColumns;
            sceneGuiTool  = ScriptableObject.CreateInstance <LevelInspectorSceneGui>();

            InitiateStyle();
            //incase OnEnable did nothing?
            if (ModeActions == null)
            {
                ModeActions = new Dictionary <Mode, System.Action <int, int> >();
                ModeActions.Add(Mode.Painting, Paint);
                ModeActions.Add(Mode.Delete, Erase);
                ModeActions.Add(Mode.Edit, Edit);
            }
        }
예제 #2
0
 private void Awake()
 {
     _instance = this as Level;
 }
예제 #3
0
 public static IEnumerator LoadLevel(string sceneName)
 {
     Application.LoadLevelAdditive(sceneName);
     yield return 0;
     _level = GameObject.FindObjectOfType<Level>();
 }