/// <summary> /// 获取对象池中游戏对象 /// </summary> /// <param name="name">Name.</param> public GameObject Spawn(string name) { if (!poolDic.ContainsKey(name)) { Register(name); } Subpool subpool = poolDic [name]; return(subpool.SubPoolSpawn()); }
/// <summary> /// 获取对象池中游戏对象 /// </summary> /// <param name="name">Name.</param> public GameObject Spawn(GameObject obj, Transform parent, Vector3 position, Quaternion quaternion) { if (!poolDic.ContainsKey(obj.name)) { Register(obj); } Subpool subpool = poolDic[obj.name]; return(subpool.SubPoolSpawn(parent, position, quaternion)); }