1
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user