public void Update() { if (!this.SpawnAllObjectsAtOnce) { mSpawnTimer.Update(); } }
private void Update() { if (mStartedEmitting) { mDurationTimer.Update(); mFireTimer.Update(); if (mDurationTimer.TimeReached && this.Duration != -1f) { Stop(); } } }
public void Update() { mFTimer.Update(); // If we've detected that we have not moved much relative to the last anchor point, // start a timer. If the timer finishes then we will assume the host hasn't moved much // in the last X seconds. If we detect a movement, stop and reset the timer. // ALTERNATE: If host is on a moving platform, we can start counting as well but that flag // must be set externally by the platform itself. if (!mBodyHasMoved || this.IsOnMovingPlatform) { if (!mTimer.Enabled) { mTimer.Start(this.TimeToSettle); } else { mTimer.Update(); if (mTimer.TimeReached) { this.OnFinishedCallback?.Invoke(); if (this.ActivateOnSettle != null && ((this.CogTriggersOnceOnly && !mCogTriggered) || (!this.CogTriggersOnceOnly))) { this.ActivateOnSettle.Activate(this, null); mCogTriggered = true; } } } } else if (mTimer.Enabled) { mTimer.Stop(); } // Record the last position mLastPosition = this.transform.position; }