// Update is called once per frame void Update() { SheepVisitNumber = VisitSheep.GetComponent <VisitFriend> ().VisitNumber; if (SheepVisitNumber >= ExcuteVisitNumber && !IsAlreadyShow && !DialogPanel.activeSelf) { IsAlreadyShow = true; SceneManager.LoadScene("Sheep Event"); PlayerPrefs.SetString("SheepEvent", IsAlreadyShow.ToString()); tteok.GetComponent <Item> ().increaseItem(); PlayerPrefs.SetString("Tteok", "True"); } }
// Use this for initialization void Start() { if (PlayerPrefs.HasKey("SheepEvent")) { IsAlreadyShow = (PlayerPrefs.GetString("SheepEvent") == "True"); } else { IsAlreadyShow = false; } SheepVisitNumber = VisitSheep.GetComponent <VisitFriend> ().VisitNumber; }