public static void Init() { // Get existing open window or if none, make a new one: window = (SpawnEditorWindow)EditorWindow.GetWindow(typeof(SpawnEditorWindow)); window.minSize = new Vector2(670, 620); int 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(); }
void Awake() { instance = (ResourceManager)target; rscList = ResourceDB.Load(); //VerifyingList(); instance.Init(); EditorUtility.SetDirty(instance); }
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]; } } for (int i = 0; i < rscList.Count; i++) { initialValueList.Add(rscList[i].value); } if (enableRscGen) { StartCoroutine(RscGenRoutine()); } }
public void Init() //to match the rscList with the DB { 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 (enableRscGen) { StartCoroutine(RscGenRoutine()); } }