public void PlayEnd() { PersistentDataComponent p = FindObjectOfType <PersistentDataComponent>(); Time.timeScale = 0f; if (PLACEHOLDER_DATA.data.ending == PLACEHOLDER_DATA.Endings.Default) { p.CompleteAnEnding(PersistentDataComponent.EEndings.EEndings_Default); //E1.SetActive(true); p.currentEnding = PersistentDataComponent.EEndings.EEndings_Default; } if (PLACEHOLDER_DATA.data.ending == PLACEHOLDER_DATA.Endings.AllFriendsDone) { p.CompleteAnEnding(PersistentDataComponent.EEndings.EEndings_AllFriendsDone); //E2.SetActive(true); p.currentEnding = PersistentDataComponent.EEndings.EEndings_Default; } if (PLACEHOLDER_DATA.data.ending == PLACEHOLDER_DATA.Endings.Stress) { p.CompleteAnEnding(PersistentDataComponent.EEndings.EEndings_Stress); //E3.SetActive(true); p.currentEnding = PersistentDataComponent.EEndings.EEndings_Default; } if (PLACEHOLDER_DATA.data.ending == PLACEHOLDER_DATA.Endings.Time) { p.CompleteAnEnding(PersistentDataComponent.EEndings.EEndings_Time); //E4.SetActive(true); p.currentEnding = PersistentDataComponent.EEndings.EEndings_Default; } //LOAD END SceneManager.LoadScene("EndingScene"); }
void Start() { // Get the data component dataCom = GameObject.Find("DataManager").GetComponent <PersistentDataComponent>(); Assert.IsNotNull(dataCom, "Error when fetching data component"); //////// DEBUG //dataCom.CompleteAnEnding(ending); //////// ~DEBUG if (dataCom.IsAchievmentCompleted(achievement)) { GetComponent <Image>().color = unlockedColor; } else { GetComponent <Image>().color = lockedColor; } }
void Start() { // Get the datacomponent dataCom = GameObject.Find("DataManager").GetComponent <PersistentDataComponent>(); Assert.IsNotNull(dataCom, "Error when fetching data component"); }