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 (GameObjectBookmark.hasAvailableInformation)
                    {
                        foreach (var targetInfo in GameObjectBookmark.availableInformation)
                        {
                            targetInfo.Refresh();
                            targetInfo.UpdateWatchValues();
                        }
                    }
                    break;
                }

                // Reset the poll timer
                pollTimer.Reset();
                this.Repaint();
            }
        }
Ejemplo n.º 2
0
 private void OnDisable()
 {
     if (resetOnDisabled)
     {
         timer.Reset();
     }
 }
Ejemplo n.º 3
0
 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();
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Triggers this cooldown
 /// </summary>
 public void Activate()
 {
     countdown.Reset();
 }