/// <summary> /// 异步预热对象池 /// </summary> /// <param name="assetPath"></param> /// <param name="size"></param> static public void AsyncWarmPool(string assetPath, int size = 5) { //异步加载后初始化 AsyncLoad <GameObject>(assetPath, (obj) => { //异步加载完 GameObjectPoolManager.WarmPool(obj, size); }); }
/// <summary> /// 释放Gameobj /// </summary> /// <param name="gobjClone"></param> static public void ReleaseToPool(GameObject gobjClone) { GameObjectPoolManager.ReleaseObject(gobjClone); }
/// <summary> /// 从对象池加载 /// </summary> /// <returns></returns> static public GameObject LoadFormPool(string assetPath, Vector3 position, Quaternion rotation) { var obj = Load <GameObject>(assetPath); return(GameObjectPoolManager.SpawnObject(obj, position, rotation)); }
/// <summary> /// 从对象池加载 /// </summary> /// <returns></returns> static public GameObject LoadFormPool(string assetPath) { var obj = Load <GameObject>(assetPath); return(GameObjectPoolManager.SpawnObject(obj)); }
/// <summary> /// 预热对象池 /// </summary> /// <param name="assetPath"></param> /// <param name="size"></param> static public void DestroyPool(string assetPath) { var obj = Load <GameObject>(assetPath); GameObjectPoolManager.DestoryPool(obj); }
/// <summary> /// 预热对象池 /// </summary> /// <param name="assetPath"></param> /// <param name="size"></param> static public void WarmPool(string assetPath, int size = 5) { var obj = Load <GameObject>(assetPath); GameObjectPoolManager.WarmPool(obj, size); }