Exemple #1
0
 // Stun has player object, stun time in seconds, trap itself
 // player has normal y velocity but is stopped in all other velocities and cannot move controls
 void FixedUpdate()
 {
     if (player != null)
     {
         if (hit)
         {
             trapBase.Stun(player, stunDuration, this.gameObject);
         }
     }
 }
Exemple #2
0
 void FixedUpdate()
 {
     if (player != null)
     {
         if (hit)
         {
             trapBase.Stun(player, stunDuration, this.gameObject);
             anim.SetBool("Stunned", hit);
             StartCoroutine(Wait());
         }
     }
 }
Exemple #3
0
 // Update is called once per frame
 // knockback has a knockback velocity, knockup velocity, and a knockTimer to
 // force the knockback into an arc shape.
 void FixedUpdate()
 {
     if (player != null)
     {
         if (hit && knockTimer < 7 && knockTimer >= 5)
         {
             trapBase.KnockBack(player, knockBackValue, 0);
             knockTimer++;
         }
         else if (hit && knockTimer < 7)
         {
             trapBase.KnockBack(player, 0, knockUpValue);
             trapBase.Stun(player.gameObject, stunDuration);
             knockTimer++;
         }
         else
         {
             hit = false;
             anim.SetBool("Knockback", hit);
             knockTimer = 0;
         }
     }
 }