// 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; } }
public void DropDust() { dustController.RemoveDust(dustDroppedPerSecond * Director.GetManager <TimeManager>().deltaTime); }