Table of Contents

Class PrefabExtensions

Namespace
Stride.CommunityToolkit.Engine
Assembly
Stride.CommunityToolkit.dll

Extension methods for Prefab.

public static class PrefabExtensions
Inheritance
PrefabExtensions

Methods

Instantiate(Prefab, Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, Vector3 translation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, Vector3, Quaternion)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, Vector3 translation, Quaternion rotation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotation Quaternion

The Quaternion to rotate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, Vector3, Quaternion, Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, Vector3 translation, Quaternion rotation, Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotation Quaternion

The Quaternion to rotate the entities by.

scale Vector3

The Vector3 to scale the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, Vector3, Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotationEulerAngles Vector3

The X, Y and Z rotations in euler angles to rotate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, Vector3, Vector3, Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles, Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotationEulerAngles Vector3

The X, Y and Z rotations in euler angles to rotate the entities by.

scale Vector3

The Vector3 to scale the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, ref Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, ref Vector3 translation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, ref Vector3, ref Quaternion)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotation Quaternion

The Quaternion to rotate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, ref Vector3, ref Quaternion, ref Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation, ref Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotation Quaternion

The Quaternion to rotate the entities by.

scale Vector3

The Vector3 to scale the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, ref Vector3, ref Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotationEulerAngles Vector3

The X, Y and Z rotations in euler angles to rotate the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

Instantiate(Prefab, ref Vector3, ref Vector3, ref Vector3)

Instantiates a Prefab and a applies a transform to all the entites.

public static List<Entity> Instantiate(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles, ref Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entities by.

rotationEulerAngles Vector3

The X, Y and Z rotations in euler angles to rotate the entities by.

scale Vector3

The Vector3 to scale the entities by.

Returns

List<Entity>

The instantiated and translated entities.

Exceptions

ArgumentException

If prefab is null.

InstantiateSingle(Prefab)

Instantiates a Prefab that contains a single Entity.

public static Entity InstantiateSingle(this Prefab prefab)

Parameters

prefab Prefab

The Prefab to instantiate.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, Vector3, Quaternion)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Quaternion rotation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotation Quaternion

The Quaternion to rotate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, Vector3, Quaternion, Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Quaternion rotation, Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotation Quaternion

The Quaternion to rotate the entity by.

scale Vector3

The Vector3 to scale the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, Vector3, Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotationEulerAngles Vector3

The X, Y and Z rotations in radians to rotate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, Vector3, Vector3, Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles, Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotationEulerAngles Vector3

The X, Y and Z rotations in radians to rotate the entity by.

scale Vector3

The Vector3 to scale the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, ref Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, ref Vector3, ref Quaternion)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotation Quaternion

The Quaternion to rotate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, ref Vector3, ref Quaternion, ref Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation, ref Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotation Quaternion

The Quaternion to rotate the entity by.

scale Vector3

The Vector3 to scale the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, ref Vector3, ref Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotationEulerAngles Vector3

The X, Y and Z rotations in radians to rotate the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.

InstantiateSingle(Prefab, ref Vector3, ref Vector3, ref Vector3)

Instantiates a Prefab that contains a single Entity and applies a transform.

public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles, ref Vector3 scale)

Parameters

prefab Prefab

The Prefab to instantiate.

translation Vector3

The Vector3 to translate the entity by.

rotationEulerAngles Vector3

The X, Y and Z rotations in radians to rotate the entity by.

scale Vector3

The Vector3 to scale the entity by.

Returns

Entity

The instantiated and translated Entity.

Exceptions

ArgumentException

If prefab is null.

InvalidOperationException

If prefab does not have exactly 1 Entity.