Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        PlayerMovement movement = other.GetComponent <PlayerMovement>();

        if (movement != null)
        {
            movement.AddMovementSpeed(duration, bonusSpeed, staminaReduction);
            Destroy(gameObject);
            playerCombat.shurikenAmount += shurikens;
            hud.UpdateShuriken();
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        // Check if the player hits the trigger collider on the power up
        // if it is the player apply the upgrade and destroy the powerup.
        PlayerMovement movement = other.GetComponent <PlayerMovement>();

        if (movement != null)
        {
            movement.AddMovementSpeed(duration, bonusSpeed, staminaReduction);
            playerCombat.shurikenAmount += shurikens;
            hud.UpdateShuriken();
            Destroy(gameObject);
        }
    }
Ejemplo n.º 3
0
 public void PlayerPowerMovementSpeed(PlayerMovement playerMovement, float addMovementSpeed, float timeMovement)
 {
     StartCoroutine(playerMovement.AddMovementSpeed(addMovementSpeed, timeMovement));
 }