protected override void Awake() { // CALL BASE AWAKE TO ENSURE THERE ARE NO OTHER INSTANCES OF THE GAME MANAGER IN THE SCENE base.Awake(); // LOAD THE SCRIPTABLEOBJECTS TO BE USED THROUGHOUT THE GAME. SOSaveHandler = Resources.Load("ScriptableObjects/PlayerSaveFile", typeof(SOSaveFile)) as SOSaveFile; SOEffectHandler = Resources.Load("ScriptableObjects/SOEffectHandler", typeof(SOEffects)) as SOEffects; _IM = InputManager.Instance.GetComponent <InputManager>(); _WM = WindowManager.Instance.GetComponent <WindowManager>(); eventSystem = EventSystemSingleton.Instance.GetComponent <StandaloneInputModule>(); SOEffectHandler.LoadEffects(); }
protected override void OnEnable() { base.OnEnable(); _currentLevel = Application.loadedLevel; _SOSaveHandler = Resources.Load("ScriptableObjects/PlayerSaveFile", typeof(SOSaveFile)) as SOSaveFile; _stats = GameObject.Find("STATS NUMBERS").GetComponentsInChildren <Text>(); _stats[0].text = _SOSaveHandler.CurrentDeathCount.ToString(); _stats[1].text = (_SOSaveHandler.InProgressJouleShots + _SOSaveHandler.InProgressPersuaderShots).ToString(); //switch (_currentLevel) { // case 1: // _stats[2].text = FormatTime(_SOSaveHandler.CurrentLevel1Time); // _stats[3].text = FormatTime(_SOSaveHandler.BestLevel1Time); // break; // case 2: // _stats[2].text = FormatTime(_SOSaveHandler.CurrentLevel1Time); // _stats[3].text = FormatTime(_SOSaveHandler.BestLevel1Time); // break; // case 3: // _stats[2].text = FormatTime(_SOSaveHandler.CurrentLevel1Time); // _stats[3].text = FormatTime(_SOSaveHandler.BestLevel1Time); // break; //} if (_currentLevel == 3) { _continueButton.SetActive(false); firstSelected = _backToMainButton; } else { _continueButton.SetActive(true); firstSelected = _continueButton; } }
protected override void OnEnable() { base.OnEnable(); _SOSaveHandler = Resources.Load("ScriptableObjects/PlayerSaveFile", typeof(SOSaveFile)) as SOSaveFile; _stats = GameObject.Find("StatsTextBox 2").GetComponentsInChildren <Text>(); //_stats[0].text = _SOSaveHandler.DeathCount.ToString(); //_stats[1].text = _SOSaveHandler.TotalShotsFired.ToString(); //_stats[2].text = _SOSaveHandler.PersuaderShots.ToString(); //_stats[3].text = _SOSaveHandler.JouleShots.ToString(); //_stats[4].text = _SOSaveHandler.TotalEnemiesKilled.ToString(); //_stats[5].text = FormatTime(_SOSaveHandler.TotalTimePlayed); //_stats[6].text = FormatTime(_SOSaveHandler.BestLevel1Time); //_stats[7].text = FormatTime(_SOSaveHandler.BestLevel2Time); //_stats[8].text = FormatTime(_SOSaveHandler.BestLevel3Time); //_stats[5].text = _SOSaveHandler.AcidVectorsKilled.ToString(); //_stats[6].text = _SOSaveHandler.ExplosiveVectorsKilled.ToString(); //_stats[7].text = _SOSaveHandler.FlyingVectorsKilled.ToString(); //_stats[8].text = _SOSaveHandler.SnipersKilled.ToString(); //_stats[9].text = _SOSaveHandler.ChargersKilled.ToString(); }