Class SplineInstantiate
SplineInstantiate is used to automatically instantiate prefabs or objects along a spline.
Inherited Members
Namespace: UnityEngine.Splines
Assembly: solution.dll
Syntax
[ExecuteInEditMode]
[AddComponentMenu("Splines/Spline Instantiate")]
public class SplineInstantiate : SplineComponent
Properties
Name | Description |
---|---|
Container | The SplineContainer containing the targeted spline. |
CoordinateSpace | The coordinate space in which to orient the instanced object. |
ForwardAxis | Forward axis of the object, by default set to the Z Axis |
InstantiateMethod | The instantiation method to use. |
MaxPositionOffset | Maximum (X,Y,Z) position offset to randomize instanced objects positions. (X,Y and Z) values have to be higher to the ones of minPositionOffset. |
MaxRotationOffset | Maximum (X,Y,Z) euler rotation offset to randomize instanced objects rotations. (X,Y and Z) values have to be higher to the ones of minRotationOffset. |
MaxScaleOffset | Maximum (X,Y,Z) scale offset to randomize instanced objects scales. (X,Y and Z) values have to be higher to the ones of minScaleOffset. |
MaxSpacing | Maximum spacing between 2 generated instances, if equal to the minSpacing, then all instances will have the exact same spacing |
MinPositionOffset | Minimum (X,Y,Z) position offset to randomize instanced objects positions. (X,Y and Z) values have to be lower to the ones of maxPositionOffset. |
MinRotationOffset | Minimum (X,Y,Z) euler rotation offset to randomize instanced objects rotations. (X,Y and Z) values have to be lower to the ones of maxRotationOffset. |
MinScaleOffset | Minimum (X,Y,Z) scale offset to randomize instanced objects scales. (X,Y and Z) values have to be lower to the ones of maxScaleOffset. |
MinSpacing | Minimum spacing between 2 generated instances, if equal to the maxSpacing, then all instances will have the exact same spacing. |
PositionSpace | Coordinate space to use to offset positions of the instances. |
RotationSpace | Coordinate space to use to offset rotations of the instances. |
ScaleSpace | Coordinate space to use to offset rotations of the instances (usually OffsetSpace.Object). |
Seed | Value used to initialize the pseudorandom number generator of the created instances. |
UpAxis | Up axis of the object, by default set to the y-axis. |
itemsToInstantiate | The items to use in the instantiation. |
Methods
Name | Description |
---|---|
Clear() | Clear all the created instances along the spline |
Randomize() | Change the Random seed to obtain a new generation along the Spline |
SetDirty() | Set the created instances dirty to erase them next time instances will be generated (otherwise the next generation will reuse cached instances) |
UpdateInstances() | Create and update all instances along the spline based on the list of available prefabs/objects. |