예제 #1
0
 /// <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);
     });
 }
예제 #2
0
 /// <summary>
 /// 释放Gameobj
 /// </summary>
 /// <param name="gobjClone"></param>
 static public void ReleaseToPool(GameObject gobjClone)
 {
     GameObjectPoolManager.ReleaseObject(gobjClone);
 }
예제 #3
0
        /// <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));
        }
예제 #4
0
        /// <summary>
        /// 从对象池加载
        /// </summary>
        /// <returns></returns>
        static public GameObject LoadFormPool(string assetPath)
        {
            var obj = Load <GameObject>(assetPath);

            return(GameObjectPoolManager.SpawnObject(obj));
        }
예제 #5
0
        /// <summary>
        /// 预热对象池
        /// </summary>
        /// <param name="assetPath"></param>
        /// <param name="size"></param>
        static public void DestroyPool(string assetPath)
        {
            var obj = Load <GameObject>(assetPath);

            GameObjectPoolManager.DestoryPool(obj);
        }
예제 #6
0
        /// <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);
        }