IEnumerator UpdateSkillGageCoroutine() { while (true) { float skillGageValue = skillBar.fillAmount * 100; while (Mathf.Abs(SkillGage - skillGageValue) > 1) { skillGageValue = Mathf.Lerp(skillGageValue, SkillGage, 0.1f); skillBar.fillAmount = skillGageValue / 100.0f; yield return(new WaitForSeconds(0.01f)); } skillBar.fillAmount = SkillGage / 100.0f; if (SkillGage == 100) { PopinPotionColor color = GetPopinPotionColor(); Skill(color); SkillGage = 0; UsedSkillNumber[color]++; } yield return(new WaitForEndOfFrame()); } }
public void Skill(PopinPotionColor color) { switch (color) { case PopinPotionColor.Red: StartCoroutine("PotionRedCoroutine"); break; case PopinPotionColor.Green: StartCoroutine("PotionGreenCoroutine"); break; case PopinPotionColor.Blue: StartCoroutine("PotionBlueCoroutine"); break; case PopinPotionColor.Black: StartCoroutine("PotionBlackCoroutine"); break; case PopinPotionColor.Rainbow: StartCoroutine("PotionRainbowCoroutine"); break; } }
private void Skill(PopinPotionColor color) { switch (color) { case PopinPotionColor.Blue: StartCoroutine("PotionBlueCoroutine"); break; case PopinPotionColor.Black: StartCoroutine("PotionBlackCoroutine"); break; } }