예제 #1
0
        public override void DrawWindow()
        {
            base.DrawWindow();

            if (currentState == null)
            {
                EditorGUILayout.LabelField("Add state to modify:");
            }
            else
            {
                if (!collapse)
                {
                    windowRect.height = 300;
                }
                else
                {
                    windowRect.height = 100;
                }

                bool prevCollapse = collapse;

                collapse = EditorGUILayout.Toggle("Window Reduction", collapse);

                if (collapse != prevCollapse)
                {
                    CETWindow.CurrentGraph.SetStateNode(this);
                }
            }

            currentState = (State)EditorGUILayout.ObjectField(currentState, typeof(State), false);

            if (previousState != currentState)
            {
                NodeInitialize();

                //CETWindow.CurrentGraph.SetStateNode(this);
            }

            if (currentState != null)
            {
                if (serializedState == null)
                {
                    serializedState = new SerializedObject(currentState);
                    onState         = (StateActions)EditorGUILayout.ObjectField(onState, typeof(StateActions), false);
                }

                if (!collapse)
                {
                    serializedState.Update();

                    serializedState.ApplyModifiedProperties();

                    float standard = 300;

                    standard         += 1 * 20;
                    windowRect.height = standard;
                }

                CETWindow.CurrentGraph.SetStateNode(this);
            }
        }
예제 #2
0
 public void ExecuteActions(StateManager states, StateActions actions)
 {
     actions.Execute(states);
 }