Beispiel #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (attacks.Count == 0)
     {
         return;
     }
     TTA -= Time.fixedDeltaTime;
     if (currentAttack == null)
     {
         if (TTA < 0)
         {
             currentAttack = ChooseAttack();
             SetTransitionColorEffect(baseColor, currentAttack.attackColor);
             currentAttack.AttStart();
             TTA = currentAttack.duration;
         }
     }
     else
     {
         if (TTA > 0)
         {
             currentAttack.AttUpdate(TTA);
         }
         else
         {
             currentAttack.AttEnd();
             SetTransitionColorEffect(currentAttack.attackColor, baseColor);
             currentAttack = null;
             TTA           = timeBetweenAttacks;
         }
     }
 }