Class SceneAnimationPlayer
The scene animation playback actor.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorContextMenu("New/Other/Scene Animation")]
[ActorToolbox("Other", "Scene Animation")]
[Unmanaged]
public class SceneAnimationPlayer : Actor, ISerializable
Constructors
SceneAnimationPlayer()
Properties
Animation
The scene animation to play.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(0)]
[Unmanaged]
public SceneAnimation Animation { get; set; }
Property Value
SceneAnimation
|
IsPaused
Gets the value that determines whether the scene animation is paused.
Declaration
[Unmanaged]
public bool IsPaused { get; }
Property Value
System.Boolean
|
IsPlaying
Gets the value that determines whether the scene animation is playing.
Declaration
[Unmanaged]
public bool IsPlaying { get; }
Property Value
System.Boolean
|
IsStopped
Gets the value that determines whether the scene animation is stopped.
Declaration
[Unmanaged]
public bool IsStopped { get; }
Property Value
System.Boolean
|
Loop
Determines whether the scene animation should loop when it finishes playing.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(40)]
[Unmanaged]
public bool Loop { get; set; }
Property Value
System.Boolean
|
PlayOnStart
Determines whether the scene animation should auto play on game start.
Declaration
[EditorDisplay("Scene Animation", "Play On Start")]
[EditorOrder(50)]
[Unmanaged]
public bool PlayOnStart { get; set; }
Property Value
System.Boolean
|
RandomStartTime
Determines whether the scene animation should randomize the start time on play begin.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(60)]
[Unmanaged]
public bool RandomStartTime { get; set; }
Property Value
System.Boolean
|
RestoreStateOnStop
Determines whether the scene animation should restore initial state on playback stop. State is cached when animation track starts play after being stopped (not paused).
Declaration
[EditorDisplay("Scene Animation", "Restore State On Stop")]
[EditorOrder(70)]
[Unmanaged]
public bool RestoreStateOnStop { get; set; }
Property Value
System.Boolean
|
Speed
The animation playback speed factor. Scales the timeline update delta time. Can be used to speed up or slow down the sequence.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(10)]
[Unmanaged]
public float Speed { get; set; }
Property Value
System.Single
|
StartTime
The animation start time. Can be used to skip part of the sequence on begin.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(20)]
[Unmanaged]
public float StartTime { get; set; }
Property Value
System.Single
|
UpdateMode
The animation update mode.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(80)]
[Unmanaged]
public SceneAnimationPlayer.UpdateModes UpdateMode { get; set; }
Property Value
SceneAnimationPlayer.UpdateModes
|
UsePrefabObjects
Determines whether the scene animation should automatically map prefab objects from scene animation into prefab instances. Useful for reusable animations to automatically link prefab objects.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(100)]
[Unmanaged]
public bool UsePrefabObjects { get; set; }
Property Value
System.Boolean
|
UseTimeScale
Determines whether the scene animation should take into account the global game time scale for simulation updates.
Declaration
[EditorDisplay("Scene Animation", null)]
[EditorOrder(30)]
[Unmanaged]
public bool UseTimeScale { get; set; }
Property Value
System.Boolean
|
Methods
MapObject(Guid, Guid)
Adds an object mapping. The object from
represented by it's unique ID will be redirected to the specified to
. Can be used to reuse the same animation for different objects.
Declaration
[Unmanaged]
public void MapObject(Guid from, Guid to)
Parameters
System.Guid
from
The source object from the scene animation asset to replace. |
System.Guid
to
The destination object to animate. |
MapTrack(String, Guid)
Adds an object mapping for the object track. The track name from
will be redirected to the specified object to
. Can be used to reuse the same animation for different objects.
Declaration
[Unmanaged]
public void MapTrack(string from, Guid to)
Parameters
System.String
from
The source track name from the scene animation asset to replace. |
System.Guid
to
The destination object to animate. |
Pause()
Pauses the animation. Has no effect if animation is not playing.
Declaration
[Unmanaged]
public void Pause()
Play()
Starts playing the animation. Has no effect if animation is already playing.
Declaration
[Unmanaged]
public void Play()
Stop()
Stops playing the animation. Has no effect if animation is already stopped.
Declaration
[Unmanaged]
public void Stop()
Tick(Single)
Manually ticks the animation by performing the playback update with a given time delta.
Declaration
[Unmanaged]
public void Tick(float dt)
Parameters
System.Single
dt
The update delta time (in seconds). It does not get scaled by player Speed parameter. |