TransformTransitioner Class

public abstract class TransformTransitioner : CellVisualTransitionController

An abstract class designed around performing transform based World Cell Transitions. This class serves as a base class that the PositionTransitioner and ScaleTransitioner derive from. While you can theoretically derive from it yourslef to create a custom Transitioner, doing so does not make much sense as the PositionTransitioner and ScaleTransitioner should be all you need if performing transform based transitions.

Properties

Name Type Description
LODTransitionToInvisible Action<float, Transform, Vector3, int>

Must be overriden to perform a gradual LOD transition of the transform from visible to invisible.

1st Parameters (float) - Time as value between 0 (transition not started) and 1 (time elapsed = LOD Transition Time), which you will typically pass into the LODTransitionMakeInvisibleCurve.Evaluate method.

2nd Parameter (Transform) - The Transform to transition.

3rd Parameter (Vector3) - The starting Vector3 data (that was returned by the GetVectorData method).

4th Paramter (int) - The index of the Transform in the list of Transforms currently being processed. This can be used to retrieve any additional data that was stored for the Transform by StoreAdditionalData_VisibleToInvisible.

LODTransitionToVisible Action<float, Transform, Vector3, int>

Must be overriden to perform a gradual LOD transition of the transform from invisible to visible.

1st Parameters (float) - Time as value between 0 (transition not started) and 1 (time elapsed = LOD Transition Time), which you will typically pass into the LODTransitionMakeVisibleCurve.Evaluate method.

2nd Parameter (Transform) - The Transform to transition.

3rd Parameter (Vector3) - The starting Vector3 data (that was returned by the GetVectorData method).

4th Paramter (int) - The index of the Transform in the list of Transforms currently being processed. This can be used to retrieve any additional data that was stored for the Transform by StoreAdditionalData_InvisibleToVisible.

TransitionTimeDeviation float

Gets or Sets the Transition Time Deviation.

Can be used to add a small deviation to the transition times of each transform that is transitioned in a single batch.

Basically, for each transform, a random transition time will be assigned between [Transition Time - Transition Time Variation] and [Transition Time + Transition Time Variation]

For example, if Transition Time is set to 2 seconds and this value is set to 1 second, transition times will fall bewteen 1 and 3 seconds (min time is always capped at 0).

Changing this value will have no effect on any transitions currently in progress.

TransitionToInvisible Action<float, Transform, Vector3, int>

Must be overriden to perform a gradual non LOD transition of the transform from visible to invisible.

1st Parameters (float) - Time as value between 0 (transition not started) and 1 (time elapsed = Transition Time), which you will typically pass into the MakeInvisibleCurve.Evaluate method.

2nd Parameter (Transform) - The Transform to transition.

3rd Parameter (Vector3) - The starting Vector3 data (that was returned by the GetVectorData method).

4th Paramter (int) - The index of the Transform in the list of Transforms currently being processed. This can be used to retrieve any additional data that was stored for the Transform by StoreAdditionalData_VisibleToInvisible.

TransitionToVisible Action<float, Transform, Vector3, int>

Must be overriden to perform a gradual non LOD transition of the transform from invisible to visible.

1st Parameters (float) - Time as value between 0 (transition not started) and 1 (time elapsed = Transition Time), which you will typically pass into the MakeVisibleCurve.Evaluate method.

2nd Parameter (Transform) - The Transform to transition.

3rd Parameter (Vector3) - The starting Vector3 data (that was returned by the GetVectorData method).

4th Paramter (int) - The index of the Transform in the list of Transforms currently being processed. This can be used to retrieve any additional data that was stored for the Transform by StoreAdditionalData_InvisibleToVisible.

Methods

CanWorldCellsBeTransitioned(ChunkType)

public override bool CanWorldCellsBeTransitioned(ChunkType chunkType)

Overriden to return true. You can override it to return a different value.

Parameters

Name Type Description
chunkType ChunkType

The Chunk Type.

Returns

type
True, indicating all chunk types can be transitioned.


ClearAdditionalData(int)

protected virtual void ClearAdditionalData(int transformIndexToClear)

Optionally override to remove any data stored using the StoreAdditionalData methods. This is called once the transition for a transform has been completed.

Parameters

Name Type Description
transformIndexToClear int

The index of the transform. Tyically, you will have the data stored in a list and remove it using list.RemoveAt(transformIndex).


GetVectorData(Transform)

protected abstract Vector3 GetVectorData(Transform transform)

Override to return pertinent Vector3 data from the Transform. Return whatever your Transitioner deals with (position, scale, etc.)

Parameters

Name Type Description
transform Transform

The Transform to get the data from.

Returns

Vector3
The Vector data.


ImmediatelyTransitionToVisibleState(ReadOnlyList<WorldCell>, ChunkType)

public sealed override void ImmediatelyTransitionToVisibleState(ReadOnlyList<WorldCell> cells, ChunkType chunkType)

Immediately transitions the transforms of the World Cells to the visible state. You should never call this method yourself.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The World Cells to transition.

chunkType ChunkType

The Chunk Type of the Asset Chunks belonging to the World Cells.


MakeTransformInvisibleImmediately(Transform)

protected abstract void MakeTransformInvisibleImmediately(Transform transform)

Override to transition a transform immediately to the invisible state.

Parameters

Name Type Description
transform Transform

The Transform to transition.


MakeTransformVisibleImmediately(Transform)

protected abstract void MakeTransformVisibleImmediately(Transform transform)

Override to transition a transform immediately to the visible state.

Parameters

Name Type Description
transform Transform

The Transform to transition.


PrepForAnyUse()

protected virtual void PrepForAnyUse()

This is called anytime one of the TransformTransitioner's public methods is called, before the rest of the method runs. You can override it to perform any setup/configuration/etc. that is required to properly run the methods.


ResetToInvisibleState(ReadOnlyList<WorldCell>, ChunkType, bool)

public sealed override void ResetToInvisibleState(ReadOnlyList<WorldCell> cells, ChunkType chunkType, bool isApplicationPlaying)

Resets the transforms of the World Cells to the invisible state. You should never call this method yourself.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The World Cells to reset.

chunkType ChunkType

The Chunk Type of the Asset Chunks belonging to the World Cells.

isApplicationPlaying bool

Whether the game is currently running. If false, it means the method was called in the editor.


ResetToVisibleState(ReadOnlyList<WorldCell>, ChunkType, bool)

public sealed override void ResetToVisibleState(ReadOnlyList<WorldCell> cells, ChunkType chunkType, bool isApplicationPlaying)

Resets the transforms of the World Cells to the visible state. You should never call this method yourself.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The World Cells to reset.

chunkType ChunkType

The Chunk Type of the Asset Chunks belonging to the World Cells.

isApplicationPlaying bool

Whether the game is currently running. If false, it means the method was called in the editor.


StoreAdditionalData_InvisibleToVisible(Transform)

protected virtual void StoreAdditionalData_InvisibleToVisible(Transform transform)

Optionally override to store additional data in your custom transitioner for a invisible to visible transition.

Parameters

Name Type Description
transform Transform

The Transform whose data should be stored.


StoreAdditionalData_VisibleToInvisible(Transform)

protected virtual void StoreAdditionalData_VisibleToInvisible(Transform transform)

Optionally override to store additional data in your custom transitioner for a visible to invisible transition.

Parameters

Name Type Description
transform Transform

The Transform whose data should be stored.


TransitionBetweenLevelsOfDetail(ReadOnlyList<WorldCell>, ChunkType, ReadOnlyList<WorldCell>, ChunkType)

public sealed override IEnumerator<YieldInstruction> TransitionBetweenLevelsOfDetail(ReadOnlyList<WorldCell> transitionFrom, ChunkType transitionFromCellsChunkType, ReadOnlyList<WorldCell> transitionTo, ChunkType transitionToCellsChunkType)

Transitions the transforms of the World Cells to the visible state over multiple frames. You should never call this method yourself.

Parameters

Name Type Description
transitionFromCells ReadOnlyList<WorldCell>

The list of cells containing the LOD chunks which are being transitioned from (i.e., they are what is currently visible that we want to make invisible). This list is read only and may contain cells from different LODs.

transitionFromCellsChunkType ChunkType

The type of chunks (or none if they have none) belonging to the transitionFromCells.

transitionToCells ReadOnlyList<WorldCell>

The list of cells containing the LOD chunks which are being transitioned to (i.e., they are what is currently invisible that we want to make visible). This list is read only and all cells are from the same World Grouping and LOD.

transitionToCellsChunkType ChunkType

The type of chunks (or none if they have none) belonging to the transitionToCells.

Returns

IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine. See the YieldInstruction page for more info.


TransitionToInvisibleState(ReadOnlyList<WorldCell>, ChunkType)

public sealed override IEnumerator<YieldInstruction> TransitionToInvisibleState(ReadOnlyList<WorldCell> cells, ChunkType chunkType)

Transitions the transforms of the World Cells to the invisible state over multiple frames. You should never call this method yourself.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The World Cells to transition.

chunkType ChunkType

The Chunk Type of the Asset Chunks belonging to the World Cells.

Returns

IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine. See the YieldInstruction page for more info.


TransitionToVisibleState(ReadOnlyList<WorldCell>, ChunkType)

public sealed override IEnumerator<YieldInstruction> TransitionToVisibleState(ReadOnlyList<WorldCell> cells, ChunkType chunkType)

Transitions the transforms of the World Cells to the visible state over multiple frames. You should never call this method yourself.

Parameters

Name Type Description
cells ReadOnlyList<WorldCell>

The World Cells to transition.

chunkType ChunkType

The Chunk Type of the Asset Chunks belonging to the World Cells.

Returns

IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine. See the YieldInstruction page for more info.