Class Prefab
Json asset that stores the collection of scene objects including actors and scripts. In general it can serve as any grouping of scene objects (for example a level) or be used as a form of a template instantiated and reused throughout the scene.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class Prefab : JsonAssetBase
Constructors
Prefab()
Methods
GetDefaultInstance()
Requests the default prefab object instance. Deserializes the prefab objects from the asset. Skips if already done.
Declaration
[Unmanaged]
public Actor GetDefaultInstance()
Returns
Actor
The root of the prefab object loaded from the prefab. Contains the default values. It's not added to gameplay but deserialized with postLoad and init event fired. |
GetDefaultInstance(ref Guid)
Requests the default prefab object instance. Deserializes the prefab objects from the asset. Skips if already done.
Declaration
[Unmanaged]
public SceneObject GetDefaultInstance(ref Guid objectId)
Parameters
System.Guid
objectId
The ID of the object to get from prefab default object. It can be one of the child-actors or any script that exists in the prefab. Methods returns root if id is empty. |
Returns
SceneObject
The object of the prefab loaded from the prefab. Contains the default values. It's not added to gameplay but deserialized with postLoad and init event fired. |