示例#1
0
    private IEnumerator ContinuosDamage(int damage)
    {
        var delay      = new WaitForSeconds(CharacterStatusValues.DAMAGE_PERIOD);
        int iterations = (int)(CharacterStatusValues.STATUS_DURATION / CharacterStatusValues.DAMAGE_PERIOD);

        for (int i = 0; i < iterations; i++)
        {
            yield return(delay);

            CombatLogic.TakeDamage(state, null, damage);
        }

        continuosDamage = null;
    }
示例#2
0
 private void FixedUpdate()
 {
     for (int i = 0; i < count; i++)
     {
         var cds = Physics.OverlapSphere(projectiles[i].position, projectiles[i].info.size);
         foreach (var cd in cds)
         {
             if (cd.CompareTag(projectiles[i].target))
             {
                 var state = cd.GetComponent <CharacterState>();
                 CombatLogic.TakeDamage(state, projectiles[i].own, projectiles[i].info.damage, projectiles[i].info.effect);
                 Delete(i);
                 i--;
                 break;
             }
         }
     }
 }