private void OnDestroy() { if (lua_runed) { if (luaOnDestroy != null) { luaOnDestroy(); } luaOnDestroy = null; luaUpdate = null; luaStart = null; luaLateUpdate = null; scriptData.Dispose(); Injections = null; Injections_str = null; } if (enable_update) { TimeMachine.I.RemoveUpdate(xUpdate, UpdateOrder); } if (enable_lateupdate) { TimeMachine.I.RemoveLateUpdate(xLateUpdate, UpdateOrder); } if (mEventIds.Count > 0) { foreach (var i in mEventIds) { XEvent.Remove(i); } } }
protected override sealed void OnDestroy() { //Debug.Log("UI被关闭"); if (mEnableUpdate) { TimeMachine.I.RemoveUpdate(Self_Update, mUpdateOrder); } if (mEnableLateUpdate) { TimeMachine.I.RemoveLateUpdate(Self_LateUpdate, mLateUpdateOrder); } //注销事件 foreach (var item in mEventPool) { XEvent.Remove(item); } XOnDestroy(); }
public void Unregister() { XEvent.Remove(handler, name, group); }