This commit is contained in:
2026-07-13 04:48:18 +08:00
parent 04cd618b93
commit 5d4b375829
12 changed files with 269 additions and 46 deletions
+7 -1
View File
@@ -98,7 +98,13 @@ public class Pool : Singleton<Pool>
//{
// rotation = temp.transform.rotation;
//}
obj = Object.Instantiate(FishResourcesData.GetFishPrefab(id), position, rotation,parent) as GameObject;//没有就读取一个,不用存入字典
var prefab = FishResourcesData.GetFishPrefab(id);
if (prefab == null)
{
Debug.LogError($"[Pool] 找不到鱼 prefab, fishNumber={id}");
return null;
}
obj = Object.Instantiate(prefab, position, rotation,parent) as GameObject;//没有就读取一个,不用存入字典
obj.SetActive(true);
obj.name = id.ToString();