From 522ca3468a56c88cb15eaa428eb7499d3dba386f Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 23 八月 2018 11:44:27 +0800
Subject: [PATCH] 2805【前端】超值礼包新增显示仙玉余额
---
Utility/GameObjectPool.cs | 198 ++++++++++++++++++++++++------------------------
1 files changed, 99 insertions(+), 99 deletions(-)
diff --git a/Utility/GameObjectPool.cs b/Utility/GameObjectPool.cs
index 75f4bb8..1f88464 100644
--- a/Utility/GameObjectPool.cs
+++ b/Utility/GameObjectPool.cs
@@ -1,99 +1,99 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-
-public class GameObjectPool
-{
-
- private List<GameObject> m_FreeList;
- private List<GameObject> m_ActiveList;
- private GameObject m_Prefab;
-
- public int nameHashCode;
- public string name;
-
- public GameObjectPool(GameObject prefab)
- {
- name = prefab.name;
- nameHashCode = name.GetHashCode();
-
- m_Prefab = prefab;
- m_FreeList = new List<GameObject>();
- m_ActiveList = new List<GameObject>();
- }
-
- public GameObject Request()
- {
- GameObject _gameObject = null;
- if (m_FreeList.Count == 0)
- {
- _gameObject = Object.Instantiate(m_Prefab);
- _gameObject.name = name;
- }
- else
- {
- _gameObject = m_FreeList[0];
- m_FreeList.RemoveAt(0);
- }
- m_ActiveList.Add(_gameObject);
- return _gameObject;
- }
-
- public void Release(GameObject gameObject)
- {
- if (m_ActiveList.Contains(gameObject))
- {
- m_ActiveList.Remove(gameObject);
- }
- else
- {
- DesignDebug.LogWarningFormat("鎵�鍥炴敹鐨刧o瀵硅薄 {0} 骞朵笉鏄粠姹犻噷鍙栧緱鐨�...", gameObject.name);
- }
- m_FreeList.Add(gameObject);
-
- }
-
- public void Clear()
- {
- foreach (var _item in m_FreeList)
- {
- Object.Destroy(_item);
- }
- foreach (var _item in m_ActiveList)
- {
- Object.Destroy(_item);
- }
- m_FreeList.Clear();
- m_ActiveList.Clear();
- }
-
- public void Destroy()
- {
-
- Clear();
-
- m_Prefab = null;
-
- m_FreeList = null;
- m_ActiveList = null;
- }
-
-#if UNITY_EDITOR
- public void ForeachActive(System.Action<GameObject> method)
- {
- for (int i = m_ActiveList.Count - 1; i >= 0; --i)
- {
- method(m_ActiveList[i]);
- }
- }
-
- public void ForeachFree(System.Action<GameObject> method)
- {
- for (int i = m_FreeList.Count - 1; i >= 0; --i)
- {
- method(m_FreeList[i]);
- }
- }
-#endif
-}
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+
+public class GameObjectPool
+{
+
+ private List<GameObject> m_FreeList;
+ private List<GameObject> m_ActiveList;
+ private GameObject m_Prefab;
+
+ public int nameHashCode;
+ public string name;
+
+ public GameObjectPool(GameObject prefab)
+ {
+ name = prefab.name;
+ nameHashCode = name.GetHashCode();
+
+ m_Prefab = prefab;
+ m_FreeList = new List<GameObject>();
+ m_ActiveList = new List<GameObject>();
+ }
+
+ public GameObject Request()
+ {
+ GameObject _gameObject = null;
+ if (m_FreeList.Count == 0)
+ {
+ _gameObject = Object.Instantiate(m_Prefab);
+ _gameObject.name = name;
+ }
+ else
+ {
+ _gameObject = m_FreeList[0];
+ m_FreeList.RemoveAt(0);
+ }
+ m_ActiveList.Add(_gameObject);
+ return _gameObject;
+ }
+
+ public void Release(GameObject gameObject)
+ {
+ if (m_ActiveList.Contains(gameObject))
+ {
+ m_ActiveList.Remove(gameObject);
+ }
+ else
+ {
+ DebugEx.LogWarningFormat("鎵�鍥炴敹鐨刧o瀵硅薄 {0} 骞朵笉鏄粠姹犻噷鍙栧緱鐨�...", gameObject.name);
+ }
+ m_FreeList.Add(gameObject);
+
+ }
+
+ public void Clear()
+ {
+ foreach (var _item in m_FreeList)
+ {
+ Object.Destroy(_item);
+ }
+ foreach (var _item in m_ActiveList)
+ {
+ Object.Destroy(_item);
+ }
+ m_FreeList.Clear();
+ m_ActiveList.Clear();
+ }
+
+ public void Destroy()
+ {
+
+ Clear();
+
+ m_Prefab = null;
+
+ m_FreeList = null;
+ m_ActiveList = null;
+ }
+
+#if UNITY_EDITOR
+ public void ForeachActive(System.Action<GameObject> method)
+ {
+ for (int i = m_ActiveList.Count - 1; i >= 0; --i)
+ {
+ method(m_ActiveList[i]);
+ }
+ }
+
+ public void ForeachFree(System.Action<GameObject> method)
+ {
+ for (int i = m_FreeList.Count - 1; i >= 0; --i)
+ {
+ method(m_FreeList[i]);
+ }
+ }
+#endif
+}
--
Gitblit v1.8.0