diff options
author | chai <chaifix@163.com> | 2021-01-27 14:15:08 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-27 14:15:08 +0800 |
commit | 1fe4ffba72f56ccc6a89d1896142425c666887d4 (patch) | |
tree | e469b6fea9454938d3a26444982be4b25de37103 /Client/Assets/Scripts/XMainClient/XComponentMgr.cs | |
parent | 310103405588040c7bc777c802273556343cae92 (diff) |
+UILib 反编译
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XComponentMgr.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XComponentMgr.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XComponentMgr.cs b/Client/Assets/Scripts/XMainClient/XComponentMgr.cs index e690d0c5..9aba5136 100644 --- a/Client/Assets/Scripts/XMainClient/XComponentMgr.cs +++ b/Client/Assets/Scripts/XMainClient/XComponentMgr.cs @@ -8,6 +8,7 @@ namespace XMainClient {
private Dictionary<uint, int> _slots = new Dictionary<uint, int>();
+ // 复用component的池子
private Dictionary<uint, XComponentMgr.ComponentCache> _componentCache = new Dictionary<uint, XComponentMgr.ComponentCache>();
public static int ComponenCreatetCount = 0;
@@ -329,6 +330,7 @@ namespace XMainClient {
XComponent xcomponent = null;
XComponentMgr.ComponentCache componentCache = null;
+ // 先从池子中取
bool flag = this._componentCache.TryGetValue(uuid, out componentCache);
if (flag)
{
@@ -379,6 +381,7 @@ namespace XMainClient bool flag2 = this._componentCache.TryGetValue(c.ID, out componentCache);
if (flag2)
{
+ // 放到池子里
componentCache.componentCache.Enqueue(c);
}
}
|