private void Update() { if (PauseGame.IsPaused() || !isSpawning || StartOnAwake) { return; } switch (currentState) { case State.NewRound: StartNewRound(); break; case State.Playing: Play(); break; case State.Paused: WaitForClear(); break; case State.GameOver: // Debug.Log("GameOver!"); break; } if (spawnQue.Count > 0 && spawnTimer <= 0) { SpawnTest(); } else if (spawnTimer > 0) { spawnTimer -= Time.deltaTime; } }
public virtual void UpdateState(Vector3 target, float xDegree, bool isMoving) { if (PauseGame.IsPaused()) { return; } this.target = target; xDeg = xDegree; isTargetMoving = isMoving; if (!transitioning) { return; } if (transitionTimeHolder >= 1) { transitioning = false; return; } tempYPositionOffset = Mathf.SmoothStep(tempYPositionOffset, yPositionOffset, transitionTimeHolder); tempXAngleOffset = Mathf.LerpAngle(tempXAngleOffset, xAngleOffset, transitionTimeHolder); tempZoomDistancecIdle = Mathf.SmoothStep(tempZoomDistancecIdle, zoomDistance.x, transitionTimeHolder); tempZoomDistanceMoving = Mathf.SmoothStep(tempZoomDistanceMoving, zoomDistance.y, transitionTimeHolder); transitionTimeHolder += Time.deltaTime * transitionStep; }
// Update is called once per frame void Update() { if (PauseGame.IsPaused()) { return; } _bloomer.intensity.value = Mathf.Lerp(minBloom, maxBloom, _lerpInCurve.Evaluate(BeatManager.GetTimeToQuarterNote())); _exposure.fixedExposure.value = Mathf.Lerp(minExposure, maxExposure, _lerpInCurve.Evaluate(BeatManager.GetTimeToQuarterNote())); }
private void Update() { if (PauseGame.IsPaused()) { return; } Machine.Update(); CheckIfInBounds(); }
private bool EverythingWorks() { if (!target) { return(false); } if (PauseGame.IsPaused()) { return(false); } if (gameOver) { return(false); } return(true); }
// Update is called once per frame void Update() { if (!_lerping || PauseGame.IsPaused()) { return; } float value = _timer <= _lerpInTime ? _lerpInCurve.Evaluate(_timer / _lerpInTime) : _lerpOutCurve.Evaluate((_timer - _lerpInTime) / _lerpOutTime); _renderer.material.SetFloat("_" + _paramaterName, value); _timer += Time.deltaTime; if (_timer >= _lerpInTime + _lerpOutTime) { _lerping = false; _timer = 0; _renderer.material.SetFloat("_" + _paramaterName, 0); } }
void Update() { if (PauseGame.IsPaused() || GameManager.CurrentState is CinematicState) { return; } Move(); movementMachine.Update(); movementMachine.GetState <PlayerDashState>().Cooldowns(); CheckIfInBounds(); if (Time.time - lastDamagedTime >= RegenTime && !(movementMachine.CurrentState is PlayerDeathState) && CurrentHP < MaxHP) { lifeTickTimer += Time.deltaTime; if (lifeTickTimer >= LifeTick) { CurrentHP++; lifeTickTimer -= LifeTick; } } }