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.FixedDeregister(this as IUpdateSlave); }
void OnDisable() { UpdateMaster.FixedDeregister(this as IUpdateSlave); }