private void Awake() { EL = gameObject.AddComponent <EasyLevel>(); ML = gameObject.AddComponent <MediumLevel>(); HL = gameObject.AddComponent <HardLevel>(); BtnR = GameObject.Find("ButtonR").gameObject.GetComponent <ButtonCL>(); BtnB = GameObject.Find("ButtonB").gameObject.GetComponent <ButtonCL>(); BtnG = GameObject.Find("ButtonG").gameObject.GetComponent <ButtonCL>(); BtnP = GameObject.Find("ButtonP").gameObject.GetComponent <ButtonCL>(); }
private static bool TryConvertToHardLevel(string hardLevelString, out HardLevel hardLevel) { switch (hardLevelString) { case "0": hardLevel = HardLevel.Easy; return true; case "1": hardLevel = HardLevel.Normal; return true; case "2": hardLevel = HardLevel.Hard; return true; default: hardLevel = HardLevel.Easy; return false; } }
private void NewGame(HardLevel hardlevel) { GameState = GameStates.Playing; Time.timeScale = 1f; initializeScoreCanvas(); LevelSelectCanvas.SetActive(false); ScoreCanvas.SetActive(true); NewLineGenerator.Initialize(); BlocksManager.Instance.ResetGame(); switch (hardlevel) { case HardLevel.Easy: BlocksManager.Instance.AddLinesOfBlock(3); break; case HardLevel.Hard: BlocksManager.Instance.AddLinesOfBlock(4); break; case HardLevel.Nightmare: BlocksManager.Instance.AddLinesOfBlock(5); break; } }
private void SetHardLevel(HardLevel hardLevel) { switch (hardLevel) { case HardLevel.Easy: { AddLineInterval = 20; ColorNum = 2; Frequency22 = 3; Frequency33 = 10; Frequency44 = 12; WinSize = 7; break; } case HardLevel.Hard: { AddLineInterval = 20; ColorNum = 3; Frequency22 = 2; Frequency33 = 8; Frequency44 = 12; WinSize = 6; break; } case HardLevel.Nightmare: { AddLineInterval = 20; ColorNum = 4; Frequency22 = 2; Frequency33 = 8; Frequency44 = 12; WinSize = 5; break; } } }