protected override void OnWindowUpdate() { // Check whether values need to be updated pollTimer.Update(Time.deltaTime); if (pollTimer.isFinished) { switch (this.mode) { case Mode.Inspector: if (this.hasTarget) { this.currentTargetInformation.Refresh(); this.currentTargetInformation.UpdateWatchValues(); } break; case Mode.WatchList: if (StratusGameObjectBookmark.hasAvailableInformation) { foreach (var targetInfo in StratusGameObjectBookmark.availableInformation) { targetInfo.Refresh(); targetInfo.UpdateWatchValues(); } } break; } // Reset the poll timer pollTimer.Reset(); this.Repaint(); } }
private void OnDisable() { if (resetOnDisabled) { timer.Reset(); } }
private void Update() { //Trace.Script("Camera main = " + Camera.main); // If the object is visible and we haven't run the timer down if (isVisible && !visibilityTimer.isFinished && withinRange) { // If the timer finished, it means we can now announce // the object's visibility if (visibilityTimer.Update(Time.deltaTime)) { onVisible(true); } } // If the object is not visible (but previously was) // announce that too else if (!isVisible && visibilityTimer.isFinished) { onVisible(false); visibilityTimer.Reset(); } }
/// <summary> /// Triggers this cooldown /// </summary> public void Activate() { countdown.Reset(); }