/* DESC :> * 썬텐 온도 확인 후 버프 적용 */ private ETanState TanStateCheck() { characterImage.sprite = (Sprite)Resources.Load("Texture/MiniGame/tan_chr_1_front", typeof(Sprite)); float temperature = temperatureGaugeImg.sizeDelta.y; float temperPercent = (temperature / standard) * limitTemp; ETanState tanState = ETanState.OVERCOOK; if (0 < temperPercent && temperPercent < 25) { tanState = ETanState.RARE; } else if (temperPercent < 33) { tanState = ETanState.WELLDON; } if (tanState == ETanState.WELLDON) { Client.AudioManager.Play((int)FX_SOUND_TYPE.HAPPY1); GlobalData.getInstance.goldIncreaseRate *= 1.5f; } else { Client.AudioManager.Play((int)FX_SOUND_TYPE.ANGRY); GlobalData.getInstance.goldIncreaseRate *= 0.5f; } return(tanState); }
/* DESC :> * 썬텐 온도 상승 * 썬텐 결과에 따른 UI 변경 */ private IEnumerator FrameUpdate() { yield return(StartCoroutine(ReadySequence())); while (!isEnd) { Vector2 curSize = temperatureGaugeImg.sizeDelta; curSize.y += 20.0f / 9.0f; temperatureGaugeImg.sizeDelta = curSize; if (curSize.y >= 200.0f) { isEnd = true; } yield return(null); } resultBox.SetActive(true); ETanState result = TanStateCheck(); resultBoxImg.color = (result == ETanState.WELLDON) ? new Color(205.0f / 255.0f, 105.0f / 255.0f, 195.0f / 255.0f) : new Color(255.0f / 255.0f, 195.0f / 255.0f, 190.0f / 255.0f); switch (result) { case ETanState.RARE: resultLabel.text = "RARE\n!"; break; case ETanState.WELLDON: resultLabel.text = "WELL\nDON"; break; case ETanState.OVERCOOK: resultLabel.text = "OVER\nCOOK\n!"; break; } GameObjectHelper.Find("Icon (Heart)").SetActive(result == ETanState.WELLDON); faceImage.sprite = (result == ETanState.WELLDON) ? (Sprite)Resources.Load("Texture/MiniGame/tan_chr_1_face_1", typeof(Sprite)) : (Sprite)Resources.Load("Texture/MiniGame/tan_chr_1_face_2", typeof(Sprite)); faceImage.enabled = true; yield return(new WaitForSeconds(3.0f)); PlayerPrefs.SetFloat("Buf", (result == ETanState.WELLDON) ? 1.5f : 0.5f); //PlayerPrefs.Save(); PopupManager.getInstance.Show <ToPMPopup>(); }