Table of Contents

Class ScalingModule

A base class for CG modules that wish to scale objects along a path or shape

public abstract class ScalingModule : CGModule
Inheritance
Object
Component
Behaviour
MonoBehaviour
DTVersionedMonoBehaviour
ScalingModule
Derived
Inherited Members

Properties

ScaleMode

public ScaleMode ScaleMode { get; set; }

Property Value

ScaleMode

ScaleMultiplierX

Defines a scale multiplier relatively to the Relative Distance of a point on the path.

public AnimationCurve ScaleMultiplierX { get; set; }

Property Value

AnimationCurve

Remarks

Considered only when ScaleMode is set to Advanced

ScaleMultiplierY

Defines a scale multiplier relatively to the Relative Distance of a point on the path.

public AnimationCurve ScaleMultiplierY { get; set; }

Property Value

AnimationCurve

Remarks

Considered only when ScaleMode is set to Advanced

ScaleOffset

Scale is applied starting at this offset

public float ScaleOffset { get; set; }

Property Value

float

Remarks

Considered only when ScaleMode is set to Advanced

ScaleReference

Determines on what range the scale is applied: Self: the scale is applied over the Path's active range Source: the scale is applied over the Path's total length

public CGReferenceMode ScaleReference { get; set; }

Property Value

CGReferenceMode

Remarks

Considered only when ScaleMode is set to Advanced

ScaleUniform

If enabled, the same scale is applied to both X and Y axis of the cross section

public bool ScaleUniform { get; set; }

Property Value

bool

ScaleX

The (base) value of the scaling along the cross section's X axis

public float ScaleX { get; set; }

Property Value

float

ScaleY

The (base) value of the scaling along the cross section's Y axis if ScaleUniform is set to false, otherwise the ScaleX value is used instead

public float ScaleY { get; set; }

Property Value

float

Methods

GetAdvancedScale(float, float, bool, float, AnimationCurve, float, AnimationCurve)

Get the scale value along the x and y axis for a point on a path

protected static Vector2 GetAdvancedScale(float relativeDistance, float scaleOffset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)

Parameters

relativeDistance float

A value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)

scaleOffset float

ScaleOffset

isUniform bool

ScaleUniform

scaleX float

ScaleX

scaleMultiplierX AnimationCurve

ScaleMultiplierX

scaleY float

ScaleY

scaleMultiplierY AnimationCurve

ScaleMultiplierY

Returns

Vector2

GetRelativeDistance(int, CGReferenceMode, SubArray<float>, SubArray<float>)

Get the relative distance of a sample point

protected static float GetRelativeDistance(int sampleIndex, CGReferenceMode cgReferenceMode, SubArray<float> relativeDistances, SubArray<float> sourceRelativeDistances)

Parameters

sampleIndex int

the index of the sample point in the path's RelativeDistances and SourceRelativeDistances

cgReferenceMode CGReferenceMode

ScaleReference

relativeDistances SubArray<float>

RelativeDistances

sourceRelativeDistances SubArray<float>

SourceRelativeDistances

Returns

float

Exceptions

ArgumentOutOfRangeException

If cgReferenceMode has an invalid value

GetScale(int, SubArray<float>, SubArray<float>)

Get the scale value along the x and y axis for a point on a path

protected Vector2 GetScale(int sampleIndex, SubArray<float> relativeDistances, SubArray<float> sourceRelativeDistances)

Parameters

sampleIndex int

the index of the point in the path's RelativeDistances and SourceRelativeDistances

relativeDistances SubArray<float>

RelativeDistances

sourceRelativeDistances SubArray<float>

SourceRelativeDistances

Returns

Vector2

Exceptions

ArgumentOutOfRangeException

If ScaleMode has an invalid value

GetScale(float)

Gets the scale vector of a cross section at a specific position on a path

public Vector2 GetScale(float relativeDistance)

Parameters

relativeDistance float

A value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)

Returns

Vector2

The X and Y value are the scale value along those axis

GetScale(float, ScaleMode, float, bool, float, AnimationCurve, float, AnimationCurve)

Get the scale value along the x and y axis for a point on a path

protected static Vector2 GetScale(float relativeDistance, ScaleMode mode, float offset, bool isUniform, float scaleX, AnimationCurve scaleMultiplierX, float scaleY, AnimationCurve scaleMultiplierY)

Parameters

relativeDistance float

A value between 0 and 1 representing how far the point is on a pah. A value of 0 means the start of the path, and a value of 1 means the end of it. It is defined as: (the point's distance from the path's start) / (the total length of the path)

mode ScaleMode

ScaleMode

offset float

ScaleOffset

isUniform bool

ScaleUniform

scaleX float

ScaleX

scaleMultiplierX AnimationCurve

ScaleMultiplierX

scaleY float

ScaleY

scaleMultiplierY AnimationCurve

ScaleMultiplierY

Returns

Vector2

Exceptions

ArgumentOutOfRangeException

If mode has an invalid value

GetSimpleScale(bool, float, float)

Get the scale value along the x and y axis

protected static Vector2 GetSimpleScale(bool isUniform, float scaleX, float scaleY)

Parameters

isUniform bool

ScaleUniform

scaleX float

ScaleX

scaleY float

ScaleY

Returns

Vector2