ScaleAdjustment

Class in ChivalrousGames.Common

Description

Configuration to create an adjustment scale Vector3 with optional params to randomize it. Could inherit from RandomizableAdjustment, but wanted to use specific PropertyDrawer related to uniform scaling so code was copied rather than extended.

Fields

adjustment Vector3 This modification is always applied and occurs before randomization
randomize bool Indicates whether this ScaleAdjustment is to be randomized. If true, will use range random values and randomize after adjustment.
uniform bool Indicates whether this randomization should be uniform (same scaling value in all axis).
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
ScaleAdjustment();
Return
ScaleAdjustment A new instance of ScaleAdjustment
Description

Default constructor. Creates a new instance of ScaleAdjustment

Constructor
public ScaleAdjustment(Vector3 adjustment, bool randomize, bool uniform, FloatRange randomX, FloatRange randomY, FloatRange randomZ);
Parameters
adjustment Vector3 This modification is always applied and occurs before randomization
randomize bool Indicates whether this ScaleAdjustment is to be randomized. If true, will use range random values and randomize after adjustment.
uniform bool Indicates whether this randomization should be uniform (same scaling value in all axis).
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
ScaleAdjustment A new instance of ScaleAdjustment
Description

Creates a new instance of ScaleAdjustment and initializes it with params.

Constructor
public ScaleAdjustment(ScaleAdjustment scaleAdjustment);
Parameters
scaleAdjustment ScaleAdjustment The scale adjustment to use to create a new one.
Return
ScaleAdjustment A new instance of ScaleAdjustment
Description

Creates a new instance of ScaleAdjustment and initializes it with values from another ScaleAdjustment.

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 ScaleAdjustment 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 ScaleAdjustment to be randomized again by calling GetRandomizedValue.

Clone
public ScaleAdjustment Clone();
Return
ScaleAdjustment A memberwise clone of the current ScaleAdjustment
Description

Returns a memberwise clone of the current ScaleAdjustment