Exemple #1
0
        public void Init()              //to match the rscList with the DB
        {
            instance = this;

            List <Rsc> rscL = ResourceDB.Load();

            for (int i = 0; i < rscL.Count; i++)
            {
                for (int n = 0; n < rscList.Count; n++)
                {
                    if (rscL[i].ID == rscList[n].ID)
                    {
                        rscL[i].value = rscList[n].value;
                        break;
                    }
                }
            }

            rscList = rscL;

            if (carryFromLastScene)
            {
                for (int i = 0; i < lastLevelValueList.Count; i++)
                {
                    rscList[i].value = lastLevelValueList[i];
                }
            }

            if (enableRscGen)
            {
                StartCoroutine(RscGenRoutine());
            }
        }
        void Awake()
        {
            instance = (ResourceManager)target;

            rscList = ResourceDB.Load();

            //VerifyingList();
            instance.Init();
            EditorUtility.SetDirty(instance);
        }
Exemple #3
0
        public static void Init()
        {
            // Get existing open window or if none, make a new one:
            window         = (SpawnEditorWindow)EditorWindow.GetWindow(typeof(SpawnEditorWindow), false, "Spawn Editor");
            window.minSize = new Vector2(480, 620);


            int enumLength = Enum.GetValues(typeof(SpawnManager._SpawnLimit)).Length;

            spawnLimitLabel   = new string[enumLength];
            spawnLimitTooltip = new string[enumLength];
            for (int i = 0; i < enumLength; i++)
            {
                spawnLimitLabel[i] = ((SpawnManager._SpawnLimit)i).ToString();
                if ((SpawnManager._SpawnLimit)i == SpawnManager._SpawnLimit.Finite)
                {
                    spawnLimitTooltip[i] = "Finite number of waves";
                }
                if ((SpawnManager._SpawnLimit)i == SpawnManager._SpawnLimit.Infinite)
                {
                    spawnLimitTooltip[i] = "Infinite number of waves (for survival or endless mode)";
                }
            }


            enumLength       = Enum.GetValues(typeof(SpawnManager._SpawnMode)).Length;
            spawnModeLabel   = new string[enumLength];
            spawnModeTooltip = new string[enumLength];
            for (int i = 0; i < enumLength; i++)
            {
                spawnModeLabel[i] = ((SpawnManager._SpawnMode)i).ToString();
                if ((SpawnManager._SpawnMode)i == SpawnManager._SpawnMode.Continous)
                {
                    spawnModeTooltip[i] = "A new wave is spawn upon every wave duration countdown (with option to skip the timer)";
                }
                if ((SpawnManager._SpawnMode)i == SpawnManager._SpawnMode.WaveCleared)
                {
                    spawnModeTooltip[i] = "A new wave is spawned when the current wave is cleared (with option to spawn next wave in advance)";
                }
                if ((SpawnManager._SpawnMode)i == SpawnManager._SpawnMode.Round)
                {
                    spawnModeTooltip[i] = "Each wave is treated like a round. a new wave can only take place when the previous wave is cleared. Each round require initiation from user";
                }
            }


            creepList = CreepDB.Load();
            rscList   = ResourceDB.Load();
            GetSpawnManager();
        }