Пример #1
0
    void Update()
    {
        //Controllo se posso mirare
        if (canAim)
        {
            //Miro nella direzione in cui mi sto muovendo
            Aim(PlayerInputManager.GetAimVector(), PlayerInputManager.GetMovementVector());

            //Controllo se posso sparare e se sto premendo il tasto
            if (canShot && PlayerInputManager.IsShooting())
            {
                //Controllo se il firing rate è finito
                if (CheckFiringRate())
                {
                    //Sparo
                    if (OnShot != null)
                    {
                        OnShot(ShotActiveBullet);
                    }
                }
            }
        }

        //Muovo il mirino
        Crossair(PlayerInputManager.GetAimVector(), PlayerInputManager.GetMovementVector());

        //Aumento il contatore del firing rate
        firingRateTimer -= Time.deltaTime;
    }
Пример #2
0
    public override void Tick()
    {
        if (context.player.GetHealthController().GainHealthOverTime() && !healthMax)
        {
            healthMax = true;
            if (context.player.OnPlayerMaxHealth != null)
            {
                context.player.OnPlayerMaxHealth();
            }
        }

        parasitePlatform.RotationUpdate(PlayerInputManager.GetAimVector());
    }