private void Start() { GameObject persistentData = GameObject.FindGameObjectWithTag("persistentData"); audioManager = FindObjectOfType <AudioManager>(); tinderData = persistentData.GetComponent <TinderData>(); contactManager = GetComponent <contactsManager>(); curIndex = 0; tinderImage.sprite = tinderData.tinderCharacters[0].tinderImage; tinderCharacterName_txt.text = tinderData.tinderCharacters[0].name; day_txt.text = "DIA " + tinderData.curDay; matchSound.Clear(); matchSound.Add("match3"); matchSound.Add("match4"); matchSound.Add("match5"); matchSound.Add("match6"); settingsAndDay.SetActive(true); if (tinderData.matchesNumber > 0) { tutorial.gameObject.SetActive(false); } tutorialOn(); }
void OnEnable() { appSave = SaveSystem.GetInstance().appSave; tinderData = GameObject.FindGameObjectWithTag("persistentData").GetComponent <TinderData>(); contactManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <contactsManager>(); addAffinity = GameObject.FindGameObjectWithTag("GameManager").GetComponent <AddAffinity>(); storedMessages = new List <string>(); newDay = false; if (this.gameObject.tag == "Elf") { story = new Story(inkJSONAsset[tinderData.elfaDay].text); storedMessages = appSave.elfa; if (appSave.elfaJson != "") { story.state.LoadJson(appSave.elfaJson); } else { if (appSave.elfaBattle) { newDay = false; } else { newDay = true; } } } else if (this.gameObject.tag == "Orc") { story = new Story(inkJSONAsset[tinderData.orcDay].text); storedMessages = appSave.orc; if (appSave.orcJson != "") { story.state.LoadJson(appSave.orcJson); } else { if (appSave.orcBattle) { newDay = false; } else { newDay = true; } } } else if (this.gameObject.tag == "Sereia") { story = new Story(inkJSONAsset[tinderData.sereiaDay].text); storedMessages = appSave.sereia; if (appSave.sereiaJson != "") { story.state.LoadJson(appSave.sereiaJson); } else { if (appSave.sereiaBattle) { newDay = false; } else { newDay = true; } } } else { story = new Story(inkJSONAsset[tinderData.humanoDay].text); storedMessages = appSave.humano; if (appSave.humanoJson != "") { story.state.LoadJson(appSave.humanoJson); } else { if (appSave.humanoBattle) { newDay = false; } else { newDay = true; } } } if (appSave.renewDay) { newDay = true; } }