/// <summary> /// Dispose /// </summary> public void Dispose(Action _complete = null) { if (null != routine) { StopInstatiate(); } // 分帧卸载 FramingFacade.Instance.FramingExecuteByTimeArgs(allCacheStaticGameObjects, 1f /**1s内要卸载完成*/, (i, _args) => { Object.Destroy(_args); }, () => { serializedInfoConfig = null; CleraCache(); sourceDatasDict.Clear(); ResourcesMgrFacade.Instance.ReleaseSceneItems(sceneName); if (null != sceneRootNode) { sceneRootNode.Dispose(); sceneRootNode = null; } if (null != _complete) { _complete(); } }); // 不用等待释放结束,开始决定释放的时候,就不能再接收品质切换消息 AppEvent.RemoveEvent(HKCommonDefine.EVENT_PERFORMANCE_SWITH); // 移除消息监听 }
/// <summary> /// 构造函数 /// </summary> /// <param name="_sceneName"></param> /// <param name="_serializedInfo"></param> public SceneStaticItemLoader(string _sceneName, SceneSerializedInfo _serializedInfo) { sceneName = _sceneName; serializedInfoConfig = _serializedInfo; devicePerformance = (HKCommonDefine.DevicePerformance)ConfigSystemFacade.Instance.Get(HKCommonDefine.KEY_PERFORMANCE_LEVEL, (int)HKCommonDefine.DevicePerformance.MIDDLE); #if UNITY_EDITOR // editor下默认最高品质 devicePerformance = HKCommonDefine.DevicePerformance.HIGHT; #endif // 创建父节点 sceneRootNode = new SceneRootNode(_sceneName); // 切换质量设置 AppEvent.OnEvent(HKCommonDefine.EVENT_PERFORMANCE_SWITH, EventPerformanceSwith); }