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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotation
QuaternionThe Quaternion to rotate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotation
QuaternionThe Quaternion to rotate the entities by.
scale
Vector3The Vector3 to scale the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotationEulerAngles
Vector3The X, Y and Z rotations in euler angles to rotate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotationEulerAngles
Vector3The X, Y and Z rotations in euler angles to rotate the entities by.
scale
Vector3The Vector3 to scale the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotation
QuaternionThe Quaternion to rotate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotation
QuaternionThe Quaternion to rotate the entities by.
scale
Vector3The Vector3 to scale the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotationEulerAngles
Vector3The X, Y and Z rotations in euler angles to rotate the entities by.
Returns
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
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entities by.
rotationEulerAngles
Vector3The X, Y and Z rotations in euler angles to rotate the entities by.
scale
Vector3The Vector3 to scale the entities by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.
InstantiateSingle(Prefab)
public static Entity InstantiateSingle(this Prefab prefab)
Parameters
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, Vector3)
public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, Vector3, Quaternion)
public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Quaternion rotation)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotation
QuaternionThe Quaternion to rotate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, Vector3, Quaternion, Vector3)
public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Quaternion rotation, Vector3 scale)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotation
QuaternionThe Quaternion to rotate the entity by.
scale
Vector3The Vector3 to scale the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, Vector3, Vector3)
public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotationEulerAngles
Vector3The X, Y and Z rotations in radians to rotate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, Vector3, Vector3, Vector3)
public static Entity InstantiateSingle(this Prefab prefab, Vector3 translation, Vector3 rotationEulerAngles, Vector3 scale)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotationEulerAngles
Vector3The X, Y and Z rotations in radians to rotate the entity by.
scale
Vector3The Vector3 to scale the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, ref Vector3)
public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, ref Vector3, ref Quaternion)
public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotation
QuaternionThe Quaternion to rotate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, ref Vector3, ref Quaternion, ref Vector3)
public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Quaternion rotation, ref Vector3 scale)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotation
QuaternionThe Quaternion to rotate the entity by.
scale
Vector3The Vector3 to scale the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, ref Vector3, ref Vector3)
public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotationEulerAngles
Vector3The X, Y and Z rotations in radians to rotate the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.
InstantiateSingle(Prefab, ref Vector3, ref Vector3, ref Vector3)
public static Entity InstantiateSingle(this Prefab prefab, ref Vector3 translation, ref Vector3 rotationEulerAngles, ref Vector3 scale)
Parameters
prefab
PrefabThe Prefab to instantiate.
translation
Vector3The Vector3 to translate the entity by.
rotationEulerAngles
Vector3The X, Y and Z rotations in radians to rotate the entity by.
scale
Vector3The Vector3 to scale the entity by.
Returns
Exceptions
- ArgumentException
If
prefab
is null.- InvalidOperationException
If
prefab
does not have exactly 1 Entity.