private void Update() { if (date == (int)StatManager.instance.date.GetData()) { now = ResultOnOff.off; } else if (now == ResultOnOff.off) { GameObject tmp1 = GameObject.Find("ThiefLine1"); GameObject tmp2 = GameObject.Find("ThiefLine2"); GameObject tmp3 = GameObject.Find("ThiefLine3"); for (int i = 0; i < tmp1.transform.childCount; i++) { Destroy(tmp1.transform.GetChild(0).gameObject); } for (int i = 0; i < tmp2.transform.childCount; i++) { Destroy(tmp2.transform.GetChild(0).gameObject); } for (int i = 0; i < tmp3.transform.childCount; i++) { Destroy(tmp3.transform.GetChild(0).gameObject); } date = StatManager.instance.date.GetData(); ShowMsg(); now = ResultOnOff.on; } NextPage(); }
private void Start() { now = ResultOnOff.off; playStory = StoryOnOff.off; preMoney = 10000; story = new GameObject[Story.transform.childCount]; for (int i = 0; i < Story.transform.childCount; i++) { story[i] = Story.transform.GetChild(i).gameObject; } for (int i = 0; i < story.Length; i++) { story[i].SetActive(false); } resultMsg.SetActive(false); date = 0; }
public void ShowMsg() { if (now == ResultOnOff.on) { return; } if (GameObject.Find("IngredientStack") != null) { StartCoroutine(SellButton.Destroy_Menus(null, GameObject.Find("IngredientStack"))); } Destroy(GameManager.instance.customer1.obj); Destroy(GameManager.instance.customer2.obj); Destroy(GameManager.instance.customer3.obj); main.SetActive(false); Time.timeScale = 0.0f; bgs.effectSounds[14].source.Play(); backgroundChange.SetActive(false); if (!(9 <= date && date <= 15 || date == 26)) { bgmSource.Stop(); bgsSource.Stop(); } if (date == 1) { OnClickContinueButton(); return; } resultMsg.SetActive(true); TipText.text = Tips[(int)Random.Range(0.0f, Tips.Count)]; moneyText.text = (StatManager.instance.money.GetData() - preMoney) + "원"; preMoney = StatManager.instance.money.GetData(); customerText.text = metCustomer + "명"; metCustomer = 0; GameManager.instance.customer1.timer = GameManager.instance.customer2.timer = GameManager.instance.customer3.timer = 0.0f; now = ResultOnOff.on; }
public void OnClickContinueButton() { if (!(9 <= date && date <= 15 || 25 <= date && date <= 26)) { if (bgmSource.clip != bgm.bgmSounds[3].clip) { bgmSource.clip = bgm.bgmSounds[3].clip; bgsSource.Stop(); bgmSource.Play(); } } if (date == 3) { if (bgsSource.clip != bgs.bgsSounds[3].clip) { bgsSource.clip = bgs.bgsSounds[3].clip; bgmSource.Stop(); bgsSource.Play(); } } if (date == 6) { bgmSource.Stop(); bgsSource.Stop(); } if (date == 7 || date == 8) { bgmSource.time = 0; } if (date == 9) { if (bgsSource.clip != bgs.bgsSounds[3].clip) { bgsSource.clip = bgs.bgsSounds[3].clip; bgsSource.Play(); } bgmSource.clip = bgm.bgmSounds[4].clip; bgmSource.Stop(); } if (date == 11) { bgsSource.Pause(); } if (date == 17) { bgmSource.Stop(); bgsSource.Stop(); } if (date == 20 || date == 21) { bgmSource.time = 0; } if (date == 27) { bgmSource.clip = bgm.bgmSounds[7].clip; bgsSource.Stop(); bgmSource.volume *= 2; bgmSource.Play(); } now = ResultOnOff.off; resultMsg.SetActive(false); page = 1; ShowStoryPage(); }