Пример #1
0
    // Use this for initialization
    void Start()
    {
        staminaScript = FindObjectOfType <StaminaSystem>();
        healthScript  = FindObjectOfType <HealthScript>();

        pausePanel.SetActive(false);

        warningText.text = "Find your friend Booba and the rest of the squad!";
    }
Пример #2
0
    public float gravity_cutoff = -50f;                            //If the y velocity is below this value stop applying gravity


    private void Awake()
    {
        player = ReInput.players.GetPlayer(playerId);

        _rigidbody2D       = this.GetComponent <Rigidbody2D>();
        _characterCollider = this.GetComponent <BoxCollider2D>();
        _xAnimator         = this.GetComponent <XAnimator>();
        sfxPlayer          = this.GetComponent <SFXController>();
        staminaSystem      = this.GetComponent <StaminaSystem>();
    }
    void Start()
    {
        _modelAnimator = model.GetComponent <Animator>();
        StaminaSystem stamina = GetComponent <StaminaSystem>();

        if (stamina != null)
        {
            stamina.StaminaStateChanged += StamineStateChangedHandler;
        }

        SpeedSystem speed = GetComponent <SpeedSystem>();

        if (speed != null)
        {
            speed.SpeedTierIncreased += IncreaseSpeedTier;
            speed.SpeedTierDecreased += DecreaseSpeedTier;
            speed.ForcedStop         += ForcedStop;
        }
    }
Пример #4
0
    public override void OnPlayerEnter(SnowmanControl player)
    {
        PlayPowerupSound(player);
        storedPlayerStamina = player.GetComponent <StaminaSystem>();
        switch (staminaType)
        {
        case StaminaType.percent:
            storedPlayerStamina.Stamina += storedPlayerStamina.MaxStamina * (staminaPercentGain / 100);
            break;

        case StaminaType.flat:
            storedPlayerStamina.Stamina += staminaFlatGain;
            break;

        case StaminaType.infinite:
            infiniteActivated = true;
            StartCoroutine(InfiniteTimer());
            return;
        }
        Destroy(gameObject);
    }
    void Start()
    {
        _staminaSystem = GetComponent <StaminaSystem>();

        if (_staminaSystem != null)
        {
            _staminaSystem.StaminaStateChanged += StamineStateChangedHandler;
        }

        _currentSpeedTier = 0;
        if (speedTierValues.Count > 0)
        {
            _currentMinSpeed = speedTierValues[0].minSpeed;
            _currentMaxSpeed = speedTierValues[0].maxSpeed;
        }
        else
        {
            _currentMinSpeed = 0;
            _currentMaxSpeed = 0;
        }

        _currentSpeed = 0;
    }