//Add time to the passed in powerup's duration
    public void AddPowerupTime(Pickup.PICKUP_TYPE powerupType)
    {
        powerups[powerupType] += powerupDuration;

        if (powerups[powerupType] > 5f)
        {
            powerups[powerupType] = 5f;
        }
    }
Exemplo n.º 2
0
    public void HidePowerupIcon(Pickup.PICKUP_TYPE type)
    {
        if (type == Pickup.PICKUP_TYPE.fast)
        {
            jumpPowerup.SetActive(false);
        }

        if (type == Pickup.PICKUP_TYPE.slow)
        {
            movePowerup.SetActive(false);
        }

        if (type == Pickup.PICKUP_TYPE.platform)
        {
            platformPowerup.SetActive(false);
        }
    }
    //Remove powerup effect on player based on type
    public void RemoveEffect(Pickup.PICKUP_TYPE powerupType)
    {
        if (powerupType.Equals(Pickup.PICKUP_TYPE.fast))
        {
            playerStats.jumpMultiplier = playerStats.GetDefaultJumpMultiplier();
        }

        if (powerupType.Equals(Pickup.PICKUP_TYPE.slow))
        {
            playerStats.speed = playerStats.GetDefaultSpeed();
        }

        if (powerupType.Equals(Pickup.PICKUP_TYPE.platform))
        {
            playerStats.isPlatformPowerupActive = !platformPhaseBuffOn;
        }
    }
 //Add powerup with 0 duration to dictionary
 private void RegisterPowerup(Pickup.PICKUP_TYPE type)
 {
     powerups.Add(type, 0f);
 }
 //Return duration of the passed in powerup
 public float GetPowerupTime(Pickup.PICKUP_TYPE type)
 {
     return(powerups[type]);
 }