Beispiel #1
0
        public static void OpenWindow(int _flowManagerInstanceID)
        {
            FlowEditorWindow window = (FlowEditorWindow)EditorWindow.GetWindow(typeof(FlowEditorWindow), false, "Flow");

            m_flowManageInstanceID = _flowManagerInstanceID;

            // Save this so it persists after entering playmode
            EditorPrefs.SetInt("FlowManagerInstanceID", m_flowManageInstanceID);

            window.Init();
            window.Show();
        }
Beispiel #2
0
        public override void OnInspectorGUI()
        {
            if (m_debug)
            {
                base.DrawDefaultInspector();
            }
            else
            {
                serializedObject.Update();

                // Restart Options
                GUILayout.Space(10);
                GUIStyle titles = new GUIStyle();
                titles.normal.textColor = Color.white;
                titles.fontSize         = 15;
                GUILayout.Label("Restart Options", titles);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("m_restartEnabled"));
                if (serializedObject.FindProperty("m_restartEnabled").boolValue)
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("m_loopBackStage"));
                }

                // Stages
                GUILayout.Space(10);
                GUILayout.Label("Stages", titles);
                GUILayout.Space(10);

                m_stages.DoLayoutList();

                if (GUILayout.Button("Open Flow Window", GUILayout.Height(50)))
                {
                    FlowEditorWindow.OpenWindow(target.GetInstanceID());
                }

                serializedObject.ApplyModifiedProperties();
            }
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            GUILayout.Label(new GUIContent("Debug", "Restores the default inspector window"));
            m_debug = EditorGUILayout.Toggle(m_debug);
            GUILayout.EndHorizontal();
        }