private void Handle_Completed(AssetOperationHandle obj) { TextAsset temp = _handle.AssetObject as TextAsset; if (temp != null) { try { SecurityParser sp = new SecurityParser(); sp.LoadXml(temp.text); _xml = sp.ToXml(); // 解析数据 if (_xml != null) { ParseData(); } } catch (Exception ex) { GameLog.Error($"Failed to parse xml {Location}. Exception : {ex.ToString()}"); } } // 注意:为了节省内存这里立即释放了资源 _handle.Release(); _userCallback?.Invoke(); }
/// <summary> /// 销毁对象池 /// </summary> public void Destroy() { // 卸载资源对象 _handle.Release(); // 销毁克隆对象 if (_cloneObject != null) { GameObject.Destroy(_cloneObject); } // 销毁游戏对象 foreach (var item in _collector) { if (item.Go != null) { GameObject.Destroy(item.Go); } } _collector.Clear(); // 清空加载列表 _loadingSpawn.Clear(); SpawnCount = 0; }
private void OnDestroy() { _lobbyWindowHandle.Release(); _lobbyBg1Handle.Release(); _lobbyBg2Handle.Release(); _lua1Handle.Release(); _lua2Handle.Release(); }
public void UnLoad() { if (_isLoadScene) { _isLoadScene = false; _userCallback = null; _handle.Release(); } }
public void UnLoad() { if (_isLoadAsset) { _isLoadAsset = false; _userCallback = null; _handle.Release(); } }
internal void InternalDestroy() { if (Go != null) { GameObject.Destroy(Go); Go = null; } _handle.Release(); }
/// <summary> /// 销毁 /// </summary> public void Destroy() { _eventGroup.RemoveAllListener(); if (_uiRoot != null) { GameObject.Destroy(_uiRoot); _uiRoot = null; } _handle.Release(); }
/// <summary> /// 销毁对象池 /// </summary> public void Destroy() { // 卸载资源对象 _handle.Release(); // 销毁游戏对象 foreach (var go in _cache) { if (go != null) { GameObject.Destroy(go); } } _cache.Clear(); // 清空加载列表 _loadingSpawn.Clear(); SpawnCount = 0; }
internal void InternalDestroy() { // 注销回调函数 _prepareCallback = null; // 销毁面板对象 IsCreate = false; if (Go != null) { OnDestroy(); GameObject.Destroy(Go); Go = null; } // 卸载面板资源 _handle.Release(); // 移除所有缓存的事件监听 EventGrouper.RemoveAllListener(); }
private void Handle_Completed(AssetOperationHandle obj) { try { TextAsset txt = _handle.AssetObject as TextAsset; if (txt != null) { // 解析数据 ParseDataInternal(txt.bytes); } } catch (Exception ex) { MotionLog.Error($"Failed to parse config {Location}. Error : {ex.ToString()}"); } // 注意:为了节省内存这里立即释放了资源 _handle.Release(); IsPrepare = true; _userCallback?.Invoke(this); }
private void OnDestroy() { _gameWindowHandle.Release(); _photoHandle.Release(); _monsterHandle.Release(); }
private void OnDestroy() { _loginWindowHandle.Release(); }