using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PathologicalGames;//PoolManager
public class Pool_Effect : MonoBehaviour
{
public static Pool_Effect instance;//单例
#region
int coluSize = 1, rowSize = 9999;
SpawnPool spawnPool_effect;
PrefabPool prefabPool_effect;
private string effectPath = "Effects/";
private string[] effectNames = new string[]
{
"Cube",
"Cube1",
"Cube2",
"Cube3",
};//预制体对象名字 数组
#endregion//
private void Awake()
{
instance = this;
createSpawnPool("pool_Effect", "Effect", out spawnPool_effect, false, false, false, false, false, 60f);
}//
// Start is called before the first frame update
void Start()
{
initPool();
}
private void initPool()//初始化对象池
{
foreachInit(effectNames, spawnPool_effect, prefabPool_effect, effectPath, 1);
}//
/// <summary>
/// 创建 生成池
/// </summary>
/// <param name="poolGOName">池子实体 的名称</param>
/// <param name="poolName">池子的名称</param>
/// /// <param name="pool_"></param>
/// <param name="matchPoolLayer">勾选后实例化的游戏对象的Layer将用Prefab默认的。</param>
/// <param name="matchPoolScale">勾选后实例化的游戏对象的缩放比例将全是1,不勾选择用Prefab默认的。</param>
/// <param name="logMessages">是否打印日志信息</param>
/// <param name="dontReparent">勾选后实例化的对象将没有父节点,通通在最上层,建议不要勾选。</param>
/// <param name="dontDestroyOnLoad">如果为true,则将Pool的组GameObject设置为Unity的Object.DontDestroyOnLoad()</param>
/// <param name="maxParticleDespawnTime">停止等待粒子死亡的时间(以秒为单
[Unity][PoolManager]对象池加载多对象
最新推荐文章于 2025-06-09 22:28:55 发布