Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

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

            GUI.changed = false;

            Undo.RecordObject(instance, "DropManager");

            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Editing of DropManager using Inspector is not recommended\nUse the editor window instead", MessageType.Info);

            if (GUILayout.Button("Open Editor Window"))
            {
                CollectibleSpawnerEditorWindow.Init();
            }

            //EditorGUILayout.Space();

            //DrawConfigure();

            DefaultInspector();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(instance);
            }
        }
        public override void OnInspectorGUI()
        {
            if (dropManager != null)
            {
                return;
            }

            base.OnInspectorGUI();

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

            GUI.changed = false;

            Undo.RecordObject(instance, "CollectibleSpawner");

            EditorGUILayout.Space();

            serializedObject.Update();
            DrawBasicConfigure();
            serializedObject.ApplyModifiedProperties();

            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Editing of spawn item using Inspector is not recommended\nUse the editor window instead", MessageType.Info);

            if (GUILayout.Button("Open Editor Window"))
            {
                CollectibleSpawnerEditorWindow.Init(instance.gameObject);
            }

            //EditorGUILayout.Space();

            //DrawConfigure();

            DefaultInspector();

            if (GUI.changed)
            {
                EditorUtility.SetDirty(instance);
            }
        }
        public static void Init(GameObject sltObj=null)
        {
            // Get existing open window or if none, make a new one:
            window = (CollectibleSpawnerEditorWindow)EditorWindow.GetWindow(typeof (CollectibleSpawnerEditorWindow), false, "Collectible Spawner Editor");
            window.minSize=new Vector2(400, 300);
            //window.maxSize=new Vector2(375, 800);

            LoadDB();

            window.SetupCallback();

            GetAllSpawnerInScene();

            if(sltObj!=null){
                Selection.activeGameObject=sltObj;
                window.selectObj=null;
                window.OnSelectionChange();
            }
        }
        public static void Init(GameObject sltObj = null)
        {
            // Get existing open window or if none, make a new one:
            window         = (CollectibleSpawnerEditorWindow)EditorWindow.GetWindow(typeof(CollectibleSpawnerEditorWindow), false, "Collectible Spawner Editor");
            window.minSize = new Vector2(400, 300);
            //window.maxSize=new Vector2(375, 800);

            LoadDB();

            window.SetupCallback();

            GetAllSpawnerInScene();

            if (sltObj != null)
            {
                Selection.activeGameObject = sltObj;
                window.selectObj           = null;
                window.OnSelectionChange();
            }
        }
Esempio n. 5
0
 static void OpenColtSpawnerEditor()
 {
     CollectibleSpawnerEditorWindow.Init();
 }