public void load(PhaseManagerData phaseManagerData) { Debug.Log("Loading... PhaseManager"); _timeManager = GetComponent <TimeManager>(); _timeManager._onTimeStateChange += handleOnTimeStateChange; _phaseActions = JSONLoader.readPhaseActions(); m_phasesInfo = JSONLoader.readPhaseInfo(); _currentPhase = phaseManagerData.CurrentPhase; _lastPhase = phaseManagerData.LastPhase; }
void Start() { if (!PlayerPrefs.HasKey("LoadData") || PlayerPrefs.GetInt("LoadData") == 0) { _phaseActions = JSONLoader.readPhaseActions(); m_phasesInfo = JSONLoader.readPhaseInfo(); _currentPhase = (TypeFase)determinePhase(); if (_currentPhase != TypeFase.PREWORK_I) { _lastPhase = (TypeFase)DeterminePreviousPhase(_currentPhase); } } }