Beispiel #1
0
 private void StartChargeShot()
 {
     shotChargeIndicator.Show();
     chargeShotCoroutine = StartCoroutine(TransitionUtility.LerpFloat((value) =>
     {
         this.shotSpeed = value;
         shotChargeIndicator.FillAmount = value;
     },
                                                                      startValue: baseShotSpeed, endValue: maxShotSpeed,
                                                                      duration: maxChargeShotTime,
                                                                      useGameTime: true, animationCurve: chargeShotCurve)
                                          );
 }
    // Warning: this function may be called any time the player presses the A
    // button (or whatever xbox controller button is bound to shoot). This
    // includes dash
    private void OnShootPressed()
    {
        bool shootTimerRunning   = shootTimer != null;
        bool alreadyChargingShot = chargeShot != null;

        if (stateManager.IsInState(State.Posession) &&
            shootTimerRunning && !alreadyChargingShot)
        {
            shotChargeIndicator.Show();
            chargeShot = StartCoroutine(TransitionUtility.LerpFloat((value) =>
            {
                this.shotSpeed = value;
                shotChargeIndicator.FillAmount = value;
            },
                                                                    startValue: baseShotSpeed, endValue: maxShotSpeed,
                                                                    duration: maxChargeShotTime,
                                                                    useGameTime: true, animationCurve: chargeShotCurve));
        }
    }