Ejemplo n.º 1
0
        public static void LoadProgressStats()
        {
            progressDB = ProgressionStats_DB.LoadDB();
            //UpdateLabel_DamageTable();

            TDSEditorWindow.SetProgressionStats(progressDB);            //, damageTypeLabel, armorTypeLabel);
            //TDSEditorInspector.SetDamageDB(damageTableDB, damageTypeLabel, armorTypeLabel);
        }
Ejemplo n.º 2
0
 public static ProgressionStats_DB Init()
 {
     if (instance != null)
     {
         return(instance);
     }
     instance = LoadDB();
     return(instance);
 }
Ejemplo n.º 3
0
        public void Init()
        {
            if (init)
            {
                return;
            }
            init = false;

            if (!enableLeveling)
            {
                return;
            }

            if (loadStatsFromDB)
            {
                ProgressionStats_DB.CopyStats(this);
            }
            else
            {
                stats.VerifyExpList();
            }
        }
Ejemplo n.º 4
0
        public override bool OnGUI()
        {
            if (!base.OnGUI())
            {
                return(true);
            }

            if (window == null)
            {
                Init();
            }

            if (Selection.activeGameObject != null)
            {
                selectedComponent = Selection.activeGameObject.GetComponent <PlayerProgression>();
            }
            else
            {
                selectedComponent = null;
            }

            Undo.RecordObject(this, "window");
            Undo.RecordObject(progressDB, "ProgressDB");
            if (selectedComponent != null)
            {
                Undo.RecordObject(selectedComponent, "PlayerProgression");
            }


            if (GUI.Button(new Rect(Math.Max(260, window.position.width - 120), 5, 100, 25), "Save"))
            {
                SetDirtyTDS();
            }

            if (!ProgressionStats_DB.UpdatedToPost_2018_3())
            {
                GUI.color = new Color(0, 1f, 1f, 1f);
                if (GUI.Button(new Rect(Math.Max(260, window.position.width - 230), 5, 100, 25), "Copy Old DB"))
                {
                    ProgressionStats_DB.CopyFromOldDB();
                }
                GUI.color = Color.white;
            }


            LevelProgressionStats stats = selectedComponent != null ? selectedComponent.stats : progressDB.stats;



            float startX = 5; float startY = 5; spaceX += 25;

            if (selectedComponent != null)
            {
                EditorGUI.HelpBox(new Rect(startX, startY, 250, 25), "Editing selected component", MessageType.Info);
            }
            else
            {
                EditorGUI.HelpBox(new Rect(startX, startY, 250, 25), "Editing Global Setting (DB)", MessageType.Info);
            }
            startY += 35;

            cont = new GUIContent("Level Cap:", "");
            EditorGUI.LabelField(new Rect(startX, startY, width, height), cont, headerStyle);
            stats.levelCap = EditorGUI.DelayedIntField(new Rect(startX + spaceX, startY, widthS, height), stats.levelCap);

            if (stats.levelCap != stats.expThresholdList.Count)
            {
                EditorGUI.HelpBox(new Rect(startX + spaceX + widthS + 20, startY, 250, 40), "Experience list doesn't match level cap.\nPlease Regenerate Experience List", MessageType.Warning);
                //EditorGUI.HelpBox(new Rect(startX, startY+spaceY, 250, 40), "Experience list doesn't match level cap.\nPlease Regenerate Experience List", MessageType.Warning);
                //startY+=2*spaceY;
            }

            startY = DrawPerLevelGain(startX, startY + spaceY + 15, stats);

            spaceX -= 25;

            DrawAddPerkGained(startX + spaceX + width - 80, startY + spaceY, stats);

            startY = DrawExpListGenerator(startX, startY + spaceY, stats);


            startY += 2 * spaceY;

            visibleRectList = new Rect(startX, startY, window.position.width - 10, window.position.height - startY - 5);
            contentRectList = new Rect(startX, startY, window.position.width - 25, contentLength);

            GUI.color = new Color(.8f, .8f, .8f, .8f);
            GUI.Box(visibleRectList, "");
            GUI.color = Color.white;

            scrollPosList = GUI.BeginScrollView(visibleRectList, scrollPosList, contentRectList);

            float cachedY = startY;

            startY        = DrawLevelList(startX, startY + 5, stats);
            contentLength = startY - cachedY;

            GUI.EndScrollView();

            if (selectedComponent != null)
            {
                PrefabUtility.RecordPrefabInstancePropertyModifications(selectedComponent);
            }

            if (GUI.changed)
            {
                if (selectedComponent != null)
                {
                    EditorUtility.SetDirty(selectedComponent);
                }
                SetDirtyTDS();
            }

            return(true);
        }
Ejemplo n.º 5
0
 //protected static void UpdateLabel_DamageTable(){ TDSEditor.UpdateLabel_DamageTable(); }
 public static void SetProgressionStats(ProgressionStats_DB db)          //, string[] dmgLabel, string[] armLabel){
 {
     progressDB = db;
     //damageTypeLabel=dmgLabel;
     //armorTypeLabel=armLabel;
 }