internal void UpdateGroup(ABGroup group) { if (group != null) { _currentGroup = group; _assetTreeView.SetFocusAndEnsureSelectedItem(); _assetTreeView.UpdateGroup(group); _currentAsset = null; } }
internal ABAsset CreateAndAddToCollection(UnityEngine.Object assetObject, ABGroup group) { if (IsCreateAndAddToCollectionValid(assetObject, group)) { ABAsset asset = new ABAsset(assetObject); group.Items.Add(asset); SaveGroup(group); return(asset); } throw new Exception("Ассет не создался из-за ошибок"); }
public bool IsOpen(ABAsset asset) { foreach (var baseView in _ListOpenView) { if (baseView.DataStruct.asset == asset) { return(true); } } return(false); }
/// <summary> /// 从缓存获取面板 /// </summary> /// <returns></returns> BaseView GetBaseViewFromCache(ABAsset asset) { BaseView baseView = null; _DicNormalViews.TryGetValue(asset.ToString(), out baseView); if (baseView != null) { return(baseView); } _DicFixedViews.TryGetValue(asset.ToString(), out baseView); if (baseView != null) { return(baseView); } return(baseView); }
/// <summary> /// 只提供给BaseView调用,释放面板,只适用于normal和fixed /// </summary> public void DisposeView(ABAsset abAsset) { if (_DicNormalViews.ContainsKey(abAsset.ToString())) { Destroy(_DicNormalViews[abAsset.ToString()].gameObject); _DicNormalViews.Remove(abAsset.ToString()); AssetBundleMgr.Instance.DisposeAssetBundle(abAsset.ABPath); // 卸载AB包内存镜像 } if (_DicFixedViews.ContainsKey(abAsset.ToString())) { Destroy(_DicFixedViews[abAsset.ToString()].gameObject); _DicFixedViews.Remove(abAsset.ToString()); AssetBundleMgr.Instance.DisposeAssetBundle(abAsset.ABPath); // 卸载AB包内存镜像 } }
internal void Delete(ABAsset asset, ABGroup group) { if (Settings == null) { throw new FileNotFoundException("Settings is not found", ABNames.FileSettings); } if (asset == null) { throw new ArgumentNullException("SimpleAsset", "SimpleAsset is null"); } if (group == null) { throw new ArgumentNullException("GroupAssetBundlesParent", "GroupAssetBundlesParent is null"); } group.Items.Remove(asset); SaveGroup(group); }
/// <summary> /// 把面板加到显示字典中 /// </summary> /// <param name="asset"></param> /// <param name="view"></param> void AddViewToShowDic(ABAsset asset, BaseView view) { switch (view.uiType.uiViewType) { case UIViewType.Normal: if (!_DicShowNormalViews.ContainsKey(asset.ToString())) { _DicShowNormalViews.Add(asset.ToString(), view); } break; case UIViewType.Fixed: if (!_DicShowFixedViews.ContainsKey(asset.ToString())) { _DicShowFixedViews.Add(asset.ToString(), view); } break; } }
public ABAssetTreeItem(ABAsset asset, int depth) : base(asset.Name.GetHashCode(), depth, asset.Name) { Asset = asset; }
private void OnSelectAsset(ABAsset asset) { _currentAsset = asset; }
/// <summary> /// 外部调用,跳转到其他面板并且关闭当前面板 /// </summary> /// <param name="fromAsset">哪个面板资源调用的</param> /// <param name="asset">ab资源</param> /// <param name="data">数据</param> public void Jump(ABAsset fromAsset, ABAsset asset, object data = null) { Close(fromAsset.ToString()); Open(asset, data); }
public void Open(ABAsset asset, object data = null) { Open(asset.ABPath, asset.AssetName, data); }
/// <summary> /// 面板是否显示出来 /// </summary> /// <param name="abName"></param> /// <param name="assetName"></param> /// <returns></returns> public bool IsDisplay(string abName, string assetName) { ABAsset asset = new ABAsset(abName, assetName); return(IsDisplay(asset)); }
/// <summary> /// 面板是否显示出来 /// </summary> /// <param name="abName"></param> /// <param name="assetName"></param> /// <returns></returns> public bool IsDisplay(ABAsset asset) { return(_DicShowFixedViews.ContainsKey(asset.ToString()) || _DicShowNormalViews.ContainsKey(asset.ToString())); }
public void Close(ABAsset asset) { Close(asset.ToString()); }