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); } }
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); }
void OnDestroy() { if (!hasRegistered) { return; } if (!autoUpdate) { return; } hasRegistered = false; UpdateMaster.Deregister(this as IUpdateSlave); }
void OnDisable() { UpdateMaster.Deregister(this as IUpdateSlave); }
void OnDestroy() { UpdateMaster.Deregister(this as IUpdateSlave); }
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); }