public PanelAsset(Panel asset) { if (asset != null) { Name = asset.name; Id = string.IsNullOrEmpty(Name) ? 0 : StringUtil.ToHash(Name); AssetPath = null; mBuiltinAsset = asset; Mode = asset.m_Mode; Properties = asset.Properties; IsUsable = true; mIsBuiltIn = true; if (!IsSingleInstance) { mPool = new ObjectPool <Panel>(16); mPool.SetConstructor(InstantiatePanel); mPool.SetCleaner(DestroyPanel); mPool.Add(mBuiltinAsset); } else { mSingleInstance = mBuiltinAsset; } } else { IsUsable = false; } }
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); } }
public PanelAsset(JObject data) { if (data != null) { Id = data.Value <int>("id"); Name = data.Value <string>("name"); AssetPath = data.Value <string>("assetPath"); Mode = (EPanelMode)data.Value <int>("mode"); Properties = (EPanelProperty)data.Value <int>("property"); IsUsable = !string.IsNullOrEmpty(AssetPath); mIsBuiltIn = false; mBuffer = new ObjectBuffer <Panel>(IsSingleInstance ? 1 : 5); mBuffer.Creater = LoadFromResources; mBuffer.Destroier = UnloadResources; } else { IsUsable = false; } }
public PanelAsset(Panel asset) { if (asset != null) { Name = asset.name; Id = string.IsNullOrEmpty(Name) ? 0 : StringUtil.ToHash(Name); AssetPath = null; mBuiltinAsset = asset; Mode = asset.m_Mode; Properties = asset.m_Properties; asset.gameObject.SetActive(false); IsUsable = true; mIsBuiltIn = true; mBuffer = new ObjectBuffer <Panel>(IsSingleInstance ? 1 : 5); mBuffer.Creater = LoadFromBuiltin; mBuffer.Destroier = UnloadResources; mBuffer.SaveBuffer(mBuiltinAsset); } else { IsUsable = false; } }
public bool HasAllProperty(EPanelProperty property) { return((m_Properties & property) == property); }
public bool HasAnyProperty(EPanelProperty prorety) { return((m_Properties & prorety) != 0); }