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.
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.
|
LODTransitionToVisible | Action<float, Transform, Vector3, int> |
Must be overriden to perform a gradual LOD transition of the transform from invisible
to visible.
|
TransitionTimeDeviation | float |
Gets or Sets the Transition Time Deviation.
|
TransitionToInvisible | Action<float, Transform, Vector3, int> |
Must be overriden to perform a gradual non LOD transition of the transform from visible
to invisible.
|
TransitionToVisible | Action<float, Transform, Vector3, int> |
Must be overriden to perform a gradual non LOD transition of the transform from invisible
to visible.
|
public override bool CanWorldCellsBeTransitioned(ChunkType chunkType)
Overriden to return true. You can override it to return a different value.
Name | Type | Description |
---|---|---|
chunkType | ChunkType |
The Chunk Type. |
type
True, indicating all chunk types can be transitioned.
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.
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). |
protected abstract Vector3 GetVectorData(Transform transform)
Override to return pertinent Vector3 data from the Transform. Return whatever your Transitioner deals with (position, scale, etc.)
Name | Type | Description |
---|---|---|
transform | Transform |
The Transform to get the data from. |
Vector3
The Vector data.
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.
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. |
protected abstract void MakeTransformInvisibleImmediately(Transform transform)
Override to transition a transform immediately to the invisible state.
Name | Type | Description |
---|---|---|
transform | Transform |
The Transform to transition. |
protected abstract void MakeTransformVisibleImmediately(Transform transform)
Override to transition a transform immediately to the visible state.
Name | Type | Description |
---|---|---|
transform | Transform |
The Transform to transition. |
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.
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.
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. |
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.
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. |
protected virtual void StoreAdditionalData_InvisibleToVisible(Transform transform)
Optionally override to store additional data in your custom transitioner for a invisible to visible transition.
Name | Type | Description |
---|---|---|
transform | Transform |
The Transform whose data should be stored. |
protected virtual void StoreAdditionalData_VisibleToInvisible(Transform transform)
Optionally override to store additional data in your custom transitioner for a visible to invisible transition.
Name | Type | Description |
---|---|---|
transform | Transform |
The Transform whose data should be stored. |
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.
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. |
IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine.
See the
YieldInstruction page for more info.
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.
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. |
IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine.
See the
YieldInstruction page for more info.
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.
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. |
IEnumerator<YieldInstruction>
An IEnumerator<YieldInstruction> that can be iterated over or used as a coroutine.
See the
YieldInstruction page for more info.