RotationAdjustment
Description
Configuration to create an adjustment rotation Vector3 with optional params to randomize it. Could inherit from RandomizableAdjustment, but wanted to use angle specific PropertyDrawer so code was copied rather than extended.
Fields
adjustment | Vector3 | This modification is always applied and occurs before randomization |
randomize | bool | Indicates whether this RandomizableAdjustment is to be randomized. If true, will use range random values and randomize after adjustment. |
randomX | FloatRange | The x min and max value used in random calculation |
randomY | FloatRange | The y min and max value used in random calculation |
randomZ | FloatRange | The z min and max value used in random calculation |
Constructors
Constructor
RotationAdjustment();
Return
RotationAdjustment | A new instance of RotationAdjustment |
Description
Default constructor. Creates a new instance of RotationAdjustment
Constructor
public RotationAdjustment(Vector3 adjustment, bool randomize, FloatRange randomX, FloatRange randomY, FloatRange randomZ);
Parameters
adjustment | Vector3 | This modification is always applied and occurs before randomization |
randomize | bool | Indicates whether this RotationAdjustment is to be randomized. If true, will use range random values and randomize after adjustment. |
randomX | FloatRange | The x min and max value used in random calculation |
randomY | FloatRange | The y min and max value used in random calculation |
randomZ | FloatRange | The z min and max value used in random calculation |
Return
RotationAdjustment | A new instance of RotationAdjustment |
Description
Creates a new instance of RotationAdjustment and initializes it with params.
Constructor
public RotationAdjustment(RotationAdjustment rotationAdjustment);
Parameters
rotationAdjustment | RotationAdjustment | The rotation adjustment to use to create a new one. |
Return
RotationAdjustment | A new instance of RotationAdjustment |
Description
Creates a new instance of RotationAdjustment and initializes it with values from another RotationAdjustment.
Methods
GetRandomizedValue
public virtual Vector3 GetRandomizedValue(ChivalrousGames.Common.Random random);
Parameters
random | ChivalrousGames.Common.Random | [Optional] The random to use to select the random value. If not provided, last random value will be returned if any. |
Return
Vector3 | The randomized value |
Description
Gets a randomized Vector3 based on the specified random and class fields. This value is then stored in the RotationAdjustment and will only be generated again after ClearRandomizedValue is called. If GetRandomizedValue is called multiple times before ClearRandomizedValue is called, the same value is always returned.
ClearRandomizedValue
public void ClearRandomizedValue();
Description
Clears the randomized value. Allows the RandomizableAdjustment to be randomized again by calling GetRandomizedValue.
Clone
public RotationAdjustment Clone();
Return
RotationAdjustment | A memberwise clone of the current RotationAdjustment |
Description
Returns a memberwise clone of the current RotationAdjustment