Synced
GameScene.InstantiatePrefab
Section titled “GameScene.InstantiatePrefab”
- Creates a connected instance of an imported prefab in this loaded scene.
Required contracts
Section titled “Required contracts”API: scripting
Project: Inno.Scene
Scope: Runtime
Declaration
Section titled “Declaration”public InnoEngine.Scene.GameObject InnoEngine.Scene.GameScene.InstantiatePrefab(InnoEngine.Scene.PrefabAsset prefab, InnoEngine.Scene.Transform? parent = null)Parameters
Section titled “Parameters”Parameter prefab: The prefab asset that supplies the object subtree.
Parameter parent: Optional parent for the new instance.
Returns
Section titled “Returns”The newly instantiated prefab root.
Exceptions
Section titled “Exceptions”Exception T:System.ArgumentNullException: The prefab is null.
Exception T:System.InvalidOperationException: The scene is not loaded in its owning world or prefab services are unavailable.