/// <summary> /// 移除页面 /// </summary> public void RemovePackage(string _comName) { GObject tempObj = GetFairyObject(_comName); if (tempObj == null) { LogError("tempObj value nil"); return; } string tempPackageName = GetPackageName(_comName); if (string.IsNullOrEmpty(tempPackageName)) { LogError("包资源为空,无法卸载"); return; } string[] temp = tempPackageName.Split('#'); if (temp == null || temp.Length < 2) { LogError("无法解析包名 --> " + tempPackageName); return; } tempObj.Dispose(); packageList.Remove(tempPackageName); packageObjectList.Remove(tempPackageName); UIPackage.RemovePackage(temp[0], true); }
public override void Dispose() { if (IsDisposed) { return; } base.Dispose(); // 从父亲中删除自己 GetParent <FUI>()?.RemoveNoDispose(Name); // 删除所有的孩子 foreach (FUI ui in children.Values.ToArray()) { ui.Dispose(); } children.Clear(); // 删除自己的UI if (!IsRoot && !isFromFGUIPool) { GObject.Dispose(); } GObject = null; isFromFGUIPool = false; }
override public void Dispose() { if (_modalWaitPane != null && _modalWaitPane.parent == null) { _modalWaitPane.Dispose(); } base.Dispose(); }
public override void Dispose() { if (this.IsDisposed) { return; } //关闭FairyGUi组件 if (gObj != null) { gObj.Dispose(); } base.Dispose(); }
public void Destroy() { if (m_ui != null) { m_ui.Dispose(); m_ui = null; thumb = null; touchArea = null; center = null; no = null; my = null; if (timeCallBack != null) { Timers.inst.Remove(timeCallBack); timeCallBack = null; } } }
public override void Dispose() { for (int i = 0; i < 4; i++) { if (_objects[i] != null) { _objects[i].Dispose(); } } _mask1.Dispose(); _mask2.Dispose(); if (_softShadow != null) { _softShadow.Dispose(); } base.Dispose(); }
public bool Remove(GObject obj, int layer) { bool bRetVal = false; // Check if layer exists in scene if (_gameScene.ContainsKey(layer)) { lock (SceneManager.Instance.ObjectLock) { // Call the layer objects remove method bRetVal = _gameScene[layer].Remove(obj); _gameObjects.Remove(obj); obj.Dispose(); } } return(bRetVal); }
/// <summary> /// 移除页面对象 /// </summary> public void RemovePackageObject(string _comName) { string tempPackageName = GetPackageName(_comName); GObject tempObj = GetFairyObject(_comName); if (tempObj != null) { if (packageObjectList.ContainsKey(tempPackageName) && packageObjectList[tempPackageName].ContainsKey(tempObj)) { packageObjectList[tempPackageName].Remove(tempObj); } tempObj.Dispose(); } if (!packageList.ContainsKey(tempPackageName)) { return; } packageList[tempPackageName].Remove(GetFairyObjectName(_comName)); }
static void CollectUIElements(string dlg, GComponent comp, Info info) { GObject[] children = comp.GetChildren(); for (int i = 0; i < children.Length; i++) { GObject child = children[i]; string name = child.name; int pos = name.IndexOf('_'); bool isGroup = false; if (pos > 1) { string prefix = name.Substring(0, pos); if (prefixs.ContainsKey(prefix)) { int typev = prefixs[prefix]; isGroup = typev == 2; Type type = child.GetType(); var property = type.GetProperty(prefix); FieldInfo field = new FieldInfo(); field.Name = name; string cType = child.GetType().ToString(); field.Type = cType; string nType = "FairyGUI.G" + prefix; if (cType != nType) { Debug.LogErrorFormat("[{0}]{1}的类型({2})与实际需求({3})不匹配", dlg, name, cType, nType); } info.Fields.Add(field); } } if (!isGroup && child.asCom != null && child.asCom.numChildren > 0) { CollectUIElements(dlg + 1, child.asCom, info); } child.Dispose(); } comp.Dispose(); }
/// <summary> /// 内部接口 销毁显示对象 /// </summary> public void Destroy() { _mainCom.Dispose(); _mainCom = null; OnDestroy(); }