public void EndSync() { MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.Update, _RenderFrameUpdate); MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.FixedUpdate, _LogicFrameUpdate); MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.LateUpdate, _FrameUpdateEnd); MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.OnApplicationPause, _GamePaused); }
public override void Cancel() { MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this); this.Callback = null; this.CallBackWithParams = null; base.Cancel(); }
public void UpdateObstacle() { if (MainLoop.getInstance() == null) { LogMgr.LogError("please create kframework first"); return; } if (mesh != null) { MeshMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1, 1, 1)); try { Mesh2Obstacle(); Add2Rvo(); if (AutoRelease) { this.mesh = null; } this.Inited = true; } catch (System.Exception ex) { LogMgr.LogError(ex); this.Inited = true; ClearProgressBar(); } } }
public Schedule() { if (MainLoop.getInstance() != null) { MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.BeforeUpdate, UpdateSchedule); } }
internal void StartUpdate() { if (mIns.EnableSelfUpdate) { MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.Update, UpdateEvent); } }
public override void Excute() { try { if (!this.isRunning) { base.Excute(); this.m_startFrame = GameSyncCtr.mIns.RenderFrameCount; ///因为update中还有处理处理逻辑,当帧事件穿插在逻辑之间的时候,可能导致某些依赖此对象的帧逻辑判断错误,目前先放在late中 MainLoop.getInstance().RegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this); } } catch (FrameWorkException ex) { LogMgr.LogException(ex); ex.RaiseExcption(); } catch (Exception ex) { LogMgr.LogException(ex); } }
public void Destroy() { if (MainLoop.getInstance() != null) { MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.BeforeUpdate, UpdateSchedule); } scheduleList.Clear(); }
protected override void CreatedConnection(NetConnection connection) { if (FrameWorkConfig.Open_DEBUG) { LogMgr.LogFormat("Http Connected :{0}", connection); } MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.LateUpdate, this.UpdateQueue); }
protected void TryBatch() { if (this.Next != null && !this.m_isBatching) { this.m_isBatching = true; this.Next.Excute(); MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.LateUpdate, this._SequenceCall); } }
public override void release() { Close(); this.selfport = 0; this.selfip = null; MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.LateUpdate, UpdateAsync2Sync); }
protected override void CreatedConnection(NetConnection connection) { if (FrameWorkConfig.Open_DEBUG) { LogMgr.LogFormat("TCP :{0} Connection Created", connection); } MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.LateUpdate, UpdateAsync2Sync); }
public void StartSync() { this.FrameRate = Application.targetFrameRate; this.Scale = Time.timeScale; MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.FixedUpdate, _LogicFrameUpdate); MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.LateUpdate, _FrameUpdateEnd); MainLoop.getInstance().RegisterLoopEvent(MainLoopEvent.OnApplicationPause, _GamePaused); }
public override void Cancel() { base.Cancel(); if (!MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this)) { LogMgr.LogError("删除失败"); } }
protected AssetBundleCreateRequest LoadFullAssetToMemAsync(BundlePkgInfo pkginfo) { if (Application.isPlaying && MainLoop.getInstance()) { return(KAssetBundle.LoadFromFileAsync(BundlePathConvert.GetRunningPath(pkginfo.AbFileName)));; } else { return(null); } }
protected override void SetFinished() { MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this); if (this.CallBack != null) { this.CallBack(this); } base.SetFinished(); }
protected IBundleRef LoadFullAssetToMem(BundlePkgInfo pkginfo) { IBundleRef bundle = null; if (ResBundleMgr.mIns.Cache.Contains(pkginfo)) { bundle = ResBundleMgr.mIns.Cache.TryGetValue(pkginfo); return(bundle); } #if UNITY_IOS || UNITY_IPHONE || UNITY_ANDROID if (GameApplication.isPlaying && MainLoop.getInstance().OpenABMode) { AssetBundle ab = null; using (gstring.Block()) { ab = this.LoadAssetBundle(BundlePathConvert.GetRunningPath(pkginfo.AbFileName)); } if (ab == null) { this.ThrowAssetMissing(this.LoadResPath); } bundle = ResBundleMgr.mIns.Cache.PushAsset(pkginfo, ab); return(bundle); } else #endif { UnityEngine.Object target = AssetDatabaseLoad(pkginfo.EditorPath); if (target == null) { if (BundleConfig.SAFE_MODE) { this.ThrowAssetMissing(pkginfo.BundleName); } else { this.LoadState = BundleLoadState.Error; LogMgr.LogErrorFormat("Asset {0} Missing", pkginfo.BundleName); } } else { #if UNITY_EDITOR bundle = ResBundleMgr.mIns.Cache.PushEditorAsset(pkginfo, target); #endif } return(bundle); } }
protected override void SetFinished() { if (!MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this)) { LogMgr.LogError("删除失败"); } if (this.Callback != null) { this.Callback(this); } base.SetFinished(); }
public static void DestroyAttEvent(MainLoopEvent loopevent, Type tp, string methodname) { MethodInfo method = tp.GetMethod(methodname, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); if (method != null) { MainLoop.getInstance().UnRegisterLoopEvent(loopevent, method); } else { LogMgr.LogErrorFormat("cant found {0} in type :{1}", methodname, tp); } }
private GameSceneCtr() { if (MainLoop.getInstance() != null) { if (MainLoop.getInstance().HasInit) { this.Init(); } else { MainLoop.getInstance().FrameWorkDoneEvent += Init; } } }
protected override void LoadLuaFiles() { if (ResBundleMgr.mIns != null && ResBundleMgr.mIns.isDone) { base.LoadLuaFiles(); #if UNITY_EDITOR if (GameConfig.Open_DEBUG || MainLoop.getInstance().OpenLuaLOG) { this.luaState.LogGC = true; } #endif isDone = true; } }
protected AssetBundle LoadAssetBundle(string path) { if (MainLoop.getInstance().OpenABMode) { #if UNITY_IOS || UNITY_IPHONE || UNITY_ANDROID AssetBundle ab = KAssetBundle.LoadFromFile(path); return(ab); #else return(null); #endif } else { return(null); } }
protected void _BatchCall() { if (this.RunningState == CommandState.Paused) { return; } if (this.Next != null) { if (this.Next.isDone) { if (this.Next.Next != null) { this.Next = this.Next.Next; } else { this.m_isBatching = false; this.Next = null; MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.LateUpdate, this._SequenceCall); if (this.isRunning) { this.SetFinished(); } } } } else { this.m_isBatching = false; MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.LateUpdate, this._SequenceCall); if (this.isRunning) { this.SetFinished(); } } }
public override void Excute() { try { if (!this.isRunning) { base.Excute(); //if(FrameWorkConfig.Open_DEBUG) // LogMgr.LogFormat("{0} ID:{1} start . ::::Task :{2}",this,this.UID,this.m_task); ///因为update中还有处理处理逻辑,当帧事件穿插在逻辑之间的时候,可能导致某些依赖此对象的帧逻辑判断错误,目前先放在late中 MainLoop.getInstance().RegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this); } } catch (FrameWorkException ex) { LogMgr.LogException(ex); ex.RaiseExcption(); } catch (Exception ex) { LogMgr.LogException(ex); } }
public static void Destroy() { MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID); }
public override void Cancel() { base.Cancel(); MainLoop.getInstance().UnRegisterCachedAction(MainLoopEvent.BeforeUpdate, methodID, this); }
internal void EndUpdate() { MainLoop.getInstance().UnRegisterLoopEvent(MainLoopEvent.Update, UpdateEvent); }