public void PickUp() { amount++; MissileDisplay.UpdateAmountText(amount); if (amount == 1) { MissileDisplay.UpdateCooldownImage(0f); isReady = true; } }
public void Launch(Transform muzzleTransform) { if (amount == 0 || !isReady) { return; // TODO: Add SFX && UI VFX here } isReady = false; PoolManager.Release(missilePrefab, muzzleTransform.position); AudioManager.Instance.PlayRandomSFX(launchSFX); amount--; MissileDisplay.UpdateAmountText(amount); if (amount == 0) { MissileDisplay.UpdateCooldownImage(1f); } else { StartCoroutine(CooldownCoroutine()); } }
void Start() { MissileDisplay.UpdateAmountText(amount); }