public void AddPower(float stackPoint) { if (IsPowerFull) { return; } CurrentPower += stackPoint; if (CurrentPower > MaxSuperPower) { CurrentPower = 0; IsPowerFull = true; OnSuperPowerActivated?.Invoke(true); } SpawnPlus(GameManager.instance.PlayerManager.Player.StackCollector.transform.position); }
private void Update() { if (GameManager.instance.GameState != GameStates.GameOnGoing) { return; } if (IsPowerFull) { timer += Time.deltaTime; if (timer > MaxSuperPowerUsageSecond) { timer = 0; IsPowerFull = false; OnSuperPowerActivated?.Invoke(false); } } if (GameManager.instance.SmothFollow.CameraMovement.IsApproachedToEndPoint) { KickPowerBar.gameObject.SetActive(true); } }