IEnumerator CheckMoving() { while (player.getIsMoving()) { yield return(null); } player.Stop(); FSLocator.textDisplayer.reactionButton.enabled = true; FSLocator.textDisplayer.reactionButton.onClick.Invoke(); Destroy(myCorotine); }
IEnumerator MovingSound() { while (true) { if (character.getIsMoving()) { float temp = soundEffect.volume + Time.deltaTime * 4; if (temp > StaticInfoForSound.EffectSound) { temp = StaticInfoForSound.EffectSound; } soundEffect.volume = temp; } else { soundEffect.volume -= Time.deltaTime * 4; } yield return(null); } }