Пример #1
0
    public override void FormUpdate(KEditorManager manager)
    {
        if (nextState != State.None)
        {
            currentState = nextState;
            nextState    = State.None;
        }
        switch (currentState)
        {
        case State.NoScenes:
            if (sceneModel == null)
            {
                sceneModel = new SceneModel();
            }
            break;

        case State.Init:
            // On Init, we need to load up the scene names.
            loadSceneNames();


            listStyle = new GUIStyle();
            listStyle.normal.textColor  = Color.white;
            listStyle.onHover.textColor = listStyle.hover.textColor = Color.black;

            listStyle.normal.background             = listStyle.onHover.background
                                                    = listStyle.hover.background = manager.getWhiteTexture();
            listStyle.padding.left                  = listStyle.padding.right = listStyle.padding.top = listStyle.padding.bottom = 4;


            if (sceneNames.Length == 0)
            {
                currentState = State.NoScenes;
            }
            else
            {
                if (sceneModel == null)
                {
                    sceneModel = new SceneModel();
                }
                //currentState = State.CreateForm;
                currentState = State.PickScene;
            }
            break;

        case State.SaveForm:
            Kat2DEditorUtiity.saveSceneModel(sceneModel);
            loadSceneNames();
            nextState = State.PickScene;
            break;

        case State.CreateForm:
            break;
        }
    }
Пример #2
0
 private void loadSceneNames()
 {
     sceneNames = Kat2DEditorUtiity.getSceneNames();
 }