private void Start() { StartCoroutine(Flow()); CursorLockManager.ReleaseMouse(this); RenderSettings.fog = false; TimerController.Faild += () => { StartCoroutine(WhenHeFailsBigTime()); }; RandomProblem = Random.Range(0, ProblemsTriggers.Count); CurrentProblemTrigger = Instantiate(ProblemsTriggers[RandomProblem].ProblemTrigger).gameObject; ProblemsTriggers[RandomProblem].ProblemParticleSystem.Play(); FixedProblem = false; }
public override void EndGame() { GameManger.Instance.ProblemsTriggers[GameManger.Instance.RandomProblem].ProblemParticleSystem.Stop(); GameManger.Instance.TimerController.StopCoroutine(GameManger.Instance.TimerController.ClocksTicking()); GameManger.Instance.FixedProblem = true; GameManger.Instance.ProblemFixedTextShower(); GameManger.Instance.TimerController.StopTimer(); GameManger.Instance.CurrentProblemTrigger.gameObject.SetActive(false); MinigameStarted = false; GameManger.Instance.CashManager.AddMoney((int)(GameManger.Instance.TimerController.TimePassed * 100)); Destroy(gameObject); CursorLockManager.ReleaseMouse(this); base.EndGame(); }