Пример #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());
            }
        }
Пример #2
0
        private static void LoadRsc()
        {
            rscPrefabDB = ResourceDB.LoadDB();
            rscList     = rscPrefabDB.rscList;

            for (int i = 0; i < rscList.Count; i++)
            {
                rscIDList.Add(rscList[i].ID);
            }
        }
Пример #3
0
        void Awake()
        {
            instance = (ResourceManager)target;

            rscList = ResourceDB.Load();

            //VerifyingList();
            instance.Init();
            EditorUtility.SetDirty(instance);
        }
Пример #4
0
        public static List <Rsc> Load()
        {
            GameObject obj = Resources.Load("DB_UnitedSolution/ResourceDB", typeof(GameObject)) as GameObject;

                        #if UNITY_EDITOR
            if (obj == null)
            {
                obj = CreatePrefab();
            }
                        #endif

            ResourceDB instance = obj.GetComponent <ResourceDB>();
            return(instance.rscList);
        }
Пример #5
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();
        }
Пример #6
0
        public static List <Rsc> LoadClone()
        {
            GameObject obj      = Resources.Load("DB_UnitedSolution/ResourceDB", typeof(GameObject)) as GameObject;
            ResourceDB instance = obj.GetComponent <ResourceDB>();

            List <Rsc> newList = new List <Rsc>();

            if (instance != null)
            {
                for (int i = 0; i < instance.rscList.Count; i++)
                {
                    newList.Add(instance.rscList[i].Clone());
                }
            }

            return(newList);
        }