public PanelAsset(int id, string name, string resPath, EPanelMode mode, EPanelProperty property) { Id = id; Name = name; AssetPath = resPath; Mode = mode; Properties = property; IsUsable = !string.IsNullOrEmpty(AssetPath); mIsBuiltIn = false; mBuffer = new ObjectBuffer <Panel>(IsSingleInstance ? 1 : 5); mBuffer.Creater = LoadFromResources; mBuffer.Destroier = UnloadResources; }
public PanelAsset(int id, string name, string resPath, EPanelMode mode, EPanelProperty property) { Id = id; Name = name; AssetPath = resPath; Mode = mode; Properties = property; IsUsable = !string.IsNullOrEmpty(AssetPath); mIsBuiltIn = false; if (!IsSingleInstance) { mPool = new ObjectPool <Panel>(16); mPool.SetConstructor(InstantiatePanel); mPool.SetCleaner(DestroyPanel); } }
int GetSortOrder(EPanelMode mode) { if (m_UICamera == null) { if (mode == EPanelMode.Normal) { return(m_NormalSortingOrder); } else if (mode == EPanelMode.Dialog) { return(m_DialogSortingOrder); } else { return(1); } } else { return(1); } }