Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        Vector2 shootVector = new Vector2(Input.GetAxis("HorizontalFire"), Input.GetAxis("VerticalFire"));

        if (superMode && shootVector.magnitude <= Mathf.Epsilon)
        {
            shootVector = lastPositiveShootVector;
        }

        if (shootVector.magnitude > 0 && _currentShootCooldown >= (superMode ? .25f : 1) * shootCooldown && dustController.dustCount > 0)
        {
            lastPositiveShootVector = shootVector;
            ShootBullet(shootVector);
            _currentShootCooldown = 0;
            if (!superMode)
            {
                dustController.RemoveDust(dustCost);
            }
        }
        if (_currentShootCooldown < shootCooldown)
        {
            _currentShootCooldown += Director.GetManager <TimeManager>().deltaTime;
        }
    }
Esempio n. 2
0
 public void DropDust()
 {
     dustController.RemoveDust(dustDroppedPerSecond * Director.GetManager <TimeManager>().deltaTime);
 }