public void EndFlash()
    {
        if (BlinkObject != null)
        {
            BlinkObject.SetActive(ActiveAtEnd);
            flashState = !flashState;
        }
        if (BlinkRenderer != null)
        {
            BlinkRenderer.enabled = (ActiveAtEnd);
            flashState            = !flashState;
        }
        //reset timers
        curFreq    = 0f;
        curCounter = 0f;
        curDelay   = 0f;
        //unregister
        UpdateMaster.Deregister(this as IUpdateSlave);
        isFlashing = false;

        GameObjectOperations.EnableDisableGameObjects(enableAtEnd, true);
        GameObjectOperations.EnableDisableGameObjects(disableAtEnd, false);

        if (disableSelfAtEnd)
        {
            this.gameObject.SetActive(false);
        }
    }
Пример #2
0
 public void OnDestroy()
 {
     //needed to stop error when closing game.
     applicationIsQuitting = true;
     //you must make sure that you unregister the object if the object is destroyed, or else update will be called even if the object no longer exists!
     UpdateMaster.Deregister(this as IUpdateSlave);
 }
Пример #3
0
 void OnDestroy()
 {
     if (!hasRegistered)
     {
         return;
     }
     if (!autoUpdate)
     {
         return;
     }
     hasRegistered = false;
     UpdateMaster.Deregister(this as IUpdateSlave);
 }
Пример #4
0
 void OnDisable()
 {
     UpdateMaster.Deregister(this as IUpdateSlave);
 }
Пример #5
0
 void OnDestroy()
 {
     UpdateMaster.Deregister(this as IUpdateSlave);
 }
Пример #6
0
 void OnDestroy()
 {
     //you must make sure that you unregister the object if the object is destroyed, or else update will be called even if the object no longer exists!
     UpdateMaster.Deregister(this as IUpdateSlave);
 }