public static Transform Populate(this object o, Pool poolID, GameObject prefab, Vector3 startPosition = default(Vector3), Quaternion startRotation = default(Quaternion), Transform parent = null, WorldParenters parenters = WorldParenters.Level) { var parenter = parent ?? Toolbox.Get <ProcessingScene>().Get(parenters); var go = poolID == Pool.None ? Object.Instantiate(prefab, startPosition, startRotation, parenter).transform : ProcessingGoPool.HandleSpawn(poolID, prefab, startPosition, startRotation, parenter).transform; go.position = startPosition; return(go); }
public static Transform Populate(this object o, Pool poolID, string prefabID, Vector3 startPosition = default(Vector3), Quaternion startRotation = default(Quaternion), Transform parent = null, WorldParenters parenters = WorldParenters.Level) { var parenter = parent ?? ProcessingScene.Default.Get(parenters); var prefab = ProcessingResources.GetPrefab <GameObject>(prefabID); var go = poolID == Pool.None ? Object.Instantiate(prefab, startPosition, startRotation, parenter).transform : ProcessingGoPool.HandleSpawn(poolID, prefab, startPosition, startRotation, parenter).transform; go.localPosition = startPosition; go.position = startPosition; return(go); }