예제 #1
0
 IEnumerator Heal(ThirdPersonCharacter player, float healRepeatRate)
 {
     while (_isHealing)
     {
         player.Heal(healAmount);
         Heal(player, healRepeatRate);
         yield return(new WaitForSeconds(healRepeatRate));
     }
 }
예제 #2
0
        private void OnTriggerEnter(Collider other)
        {
            _isHealing = true;

            ThirdPersonCharacter player = other.gameObject.GetComponent <ThirdPersonCharacter>();

            if (player != null)
            {
                if (Repeating)
                {
                    StartCoroutine(Heal(player, healRepeatRate));
                }
                else
                {
                    player.Heal(healAmount);
                }
            }
        }