예제 #1
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            window         = (ProgressStatsEditorWindow)EditorWindow.GetWindow(typeof(ProgressStatsEditorWindow), false, "Progress Stats Editor");
            window.minSize = new Vector2(400, 300);
            //~ window.maxSize=new Vector2(375, 800);

            LoadDB();
        }
예제 #2
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            window         = (ProgressStatsEditorWindow)EditorWindow.GetWindow(typeof(ProgressStatsEditorWindow), false, "Progress Stats Editor");
            window.minSize = new Vector2(400, 300);
            //~ window.maxSize=new Vector2(375, 800);

            LoadDB();

            window.sumRecursively = progressDB.stats.sumRecursively;
            window.expTHM         = progressDB.stats.expTHM;
            window.expTHC         = progressDB.stats.expTHC;
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

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

            GUI.changed = false;

            serializedObject.Update();

            cont = new GUIContent("Enable Leveling:", "Check to enable leveling system\nOtherwise player will not level up");
            instance.enableLeveling = EditorGUILayout.Toggle(cont, instance.enableLeveling);
            //EditorGUILayout.PropertyField(serializedObject.FindProperty("enableLeveling"), cont);

            cont = new GUIContent("Use Global Stats:", "Check to use the progression stats from global db.\nWhen unchecked, local progression stats on this component will be used instead\nYou can edit the stats on this component in Progression Stats Editor Window while selecting this game-object.");
            instance.loadStatsFromDB = EditorGUILayout.Toggle(cont, instance.loadStatsFromDB);
            //EditorGUILayout.PropertyField(serializedObject.FindProperty("loadStatsFromDB"), cont);

            EditorGUILayout.Space();

            EditorGUILayout.HelpBox("Editing PlayerProgression's stats using Inspector is not recommended.\nPlease use the editor window instead", MessageType.Info);
            if (GUILayout.Button("Progression Stats Editor Window"))
            {
                ProgressStatsEditorWindow.Init();
            }

            EditorGUILayout.Space();

            DefaultInspector();

            serializedObject.ApplyModifiedProperties();
            if (GUI.changed)
            {
                EditorUtility.SetDirty(instance);
            }
        }
예제 #4
0
 static void OpenProgressionStatsEditor()
 {
     ProgressStatsEditorWindow.Init();
 }