public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            if (instance == null)
            {
                Awake();
            }

            GUI.changed = false;

            EditorGUILayout.Space();


            if (!Application.isPlaying)
            {
                if (GUILayout.Button("Generate Unit"))
                {
                    instance._GenerateUnit();
                }
            }


            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Editing of Faction Information via Inspector is not recommended, please use FactionManager-EditorWindow instead", MessageType.Info);
            //GUIStyle style=new GUIStyle();
            //style.wordWrap=true;
            //EditorGUILayout.LabelField("Editing of Faction Information via Inspector is not recommended, please use FactionManager-EditorWindow instead", style);
            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();


            EditorGUILayout.Space();
            if (GUILayout.Button("Open FactionManager-EditorWindow"))
            {
                NewFactionManagerEditorWindow.Init();
            }
            EditorGUILayout.Space();


            DefaultInspector();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(instance);
            }
        }
        public static void Init(FactionManager facManager = null)
        {
            // Get existing open window or if none, make a new one:
            window         = (NewFactionManagerEditorWindow)EditorWindow.GetWindow(typeof(NewFactionManagerEditorWindow), false, "FactionManager Editor");
            window.minSize = new Vector2(420, 300);

            LoadDB();

            InitLabel();

            if (facManager != null)
            {
                instance = facManager;
            }
        }
Exemplo n.º 3
0
 static void OpenFactionManagerEditorWindow()
 {
     //FactionManagerEditorWindow.Init();
     NewFactionManagerEditorWindow.Init();
 }