private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            Death.PlayerDeath();
        }

        //snowy.Death();
    }
示例#2
0
 void Growth()
 {
     if (this.health > 0)
     {
         if (this.health <= 30)
         {
             this.wallJumpAvailable = true;
             this.dashAvailable     = true;
             this.dashSpeed         = baseDashSpeed;
             this.speed             = baseSpeed;
             this.jumpForce         = baseJumpForce;
             this.extraJumpsValue   = 1;
             this.hud.SetGrowth(growthState);
         }
         if (this.health > 30 && this.health <= 60)
         {
             this.wallJumpAvailable = true;
             this.dashAvailable     = true;
             this.dashSpeed         = baseDashSpeed - 1;
             this.speed             = baseSpeed - 1;
             this.jumpForce         = baseJumpForce - (int)0.5;
             this.extraJumpsValue   = 1;
             this.hud.SetGrowth(growthState);
         }
         if (this.health > 60 && this.health <= 90)
         {
             this.wallJumpAvailable = false;
             this.dashAvailable     = false;
             this.speed             = baseSpeed - 2;
             this.jumpForce         = baseJumpForce - (int)0.7;
             this.extraJumpsValue   = 0;
             this.hud.SetGrowth(growthState);
         }
     }
     else
     {
         Death.PlayerDeath();
     }
 }