示例#1
0
 void Awake()
 {
     _instance = this;
     if (startupPoolMode == StartupPoolMode.Awake)
     {
         CreateStartupPools();
     }
 }
示例#2
0
 public static List <T> GetPooled <T>(this T prefab) where T : Component
 {
     return(SpacePool.GetPooled(prefab, null, false));
 }
示例#3
0
 public static PrefabPool CreatePool <T>(this T prefab, int initialPoolSize) where T : Component
 {
     return(SpacePool.CreatePool(prefab, initialPoolSize));
 }
示例#4
0
 public static void Recycle <T>(this T obj) where T : Component
 {
     SpacePool.Recycle(obj);
 }
示例#5
0
 public static GameObject Spawn(this GameObject prefab, Transform parent, Vector3 position, string name = "")
 {
     return(SpacePool.FinalSpawn(prefab, parent, position, Quaternion.identity, name));
 }
示例#6
0
 public static T Spawn <T>(this T prefab, string name = "") where T : Component
 {
     return(SpacePool.Spawn(prefab, null, Vector3.zero, Quaternion.identity, name));
 }
示例#7
0
 public static T Spawn <T>(this T prefab, Transform parent, Vector3 position, string name = "") where T : Component
 {
     return(SpacePool.Spawn(prefab, parent, position, Quaternion.identity, name));
 }
示例#8
0
 public static void DestroyAll <T>(this T prefab) where T : Component
 {
     SpacePool.DestroyAll(prefab.gameObject);
 }
示例#9
0
 public static int CountSpawned(this GameObject prefab)
 {
     return(SpacePool.CountSpawned(prefab));
 }
示例#10
0
 public static int CountSpawned <T>(this T prefab) where T : Component
 {
     return(SpacePool.CountSpawned(prefab));
 }
示例#11
0
 public static void RecycleAll(this GameObject prefab)
 {
     SpacePool.RecycleAll(prefab);
 }
示例#12
0
 public static void RecycleAll <T>(this T prefab) where T : Component
 {
     SpacePool.RecycleAll(prefab);
 }
示例#13
0
 public static void Recycle(this GameObject obj, string name)
 {
     SpacePool.Recycle(name);
 }
示例#14
0
 public static void Recycle(this GameObject obj)
 {
     SpacePool.Recycle(obj);
 }
示例#15
0
 public static PrefabPool CreatePool(this GameObject prefab, int initialPoolSize)
 {
     return(SpacePool.CreatePool(prefab, initialPoolSize));
 }
示例#16
0
 public static void DestroyAll(this GameObject prefab)
 {
     SpacePool.DestroyAll(prefab);
 }
示例#17
0
 public static List <GameObject> GetSpawned(this GameObject prefab, List <GameObject> list)
 {
     return(SpacePool.GetSpawned(prefab, list, false));
 }
示例#18
0
 public static T Spawn <T>(this T prefab, Vector3 position, Quaternion rotation, string name = "") where T : Component
 {
     return(SpacePool.Spawn(prefab, null, position, rotation, name));
 }
示例#19
0
 public static PrefabPool CreatePool(this GameObject prefab)
 {
     return(SpacePool.CreatePool(prefab, 0));
 }
示例#20
0
 public static PrefabPool CreatePool <T>(this T prefab) where T : Component
 {
     return(SpacePool.CreatePool(prefab, 0));
 }
示例#21
0
 public static List <T> GetSpawned <T>(this T prefab, List <T> list) where T : Component
 {
     return(SpacePool.GetSpawned(prefab, list, false));
 }
示例#22
0
 public static GameObject Spawn(this GameObject prefab, Vector3 position, Quaternion rotation, string name = "")
 {
     return(SpacePool.FinalSpawn(prefab, null, position, rotation, name));
 }
示例#23
0
 public static List <GameObject> GetPooled(this GameObject prefab, List <GameObject> list, bool appendList)
 {
     return(SpacePool.GetPooled(prefab, list, appendList));
 }
示例#24
0
 public static GameObject Spawn(this GameObject prefab, string name = "")
 {
     return(SpacePool.FinalSpawn(prefab, null, Vector3.zero, Quaternion.identity, name));
 }
示例#25
0
 public static List <GameObject> GetPooled(this GameObject prefab)
 {
     return(SpacePool.GetPooled(prefab, null, false));
 }
示例#26
0
 public static void Recycle(this PrefabPool pool, string name)
 {
     SpacePool.Recycle(pool, name);
 }
示例#27
0
 public static List <T> GetPooled <T>(this T prefab, List <T> list, bool appendList) where T : Component
 {
     return(SpacePool.GetPooled(prefab, list, appendList));
 }