protected override void Initialize() { InstantiateScriptableObjects(); LevelManager = FindObjectOfType <LevelManager>(); PointsUIManager = FindObjectOfType <PointsUIManager>(); PatientStatusCtrl = GetComponent <PatientStatusController>(); AilmentUI = GetComponent <AilmentUIController>(); StartCoroutine(PlayOngoingParticles()); AudioSrc = GetComponents <AudioSource>()[1]; IsActionActive = false; }
private void Start() { Time.timeScale = 1; UICanvas = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <Canvas>(); var timerUI = Instantiate(ClockUIPrefab, UICanvas.transform); timerUI.GetComponent <TimerUIManager>().Initialize(this, LevelConfig.LevelTimeSecs); var goalUI = Instantiate(GoalUIPrefab, UICanvas.transform); UIManager = goalUI.GetComponent <PointsUIManager>(); UIManager.Initialize(); UIManager.UpdateUI(PatientsHealed); StartTime = LevelConfig.LevelTimeSecs; Timer = StartTime; var sun = Instantiate(SunPrefab); DayNightCycle = sun.GetComponent <Animator>(); var multiplier = 1 / (StartTime / 60); DayNightCycle.SetFloat("SpeedMultiplier", multiplier); }