AnyPortrait > Script > Animation

Animation


You can play the animation as a script.
If you enter the animation clip name as a parameter, it automatically switches to the root unit corresponding to it.
Multiple animation clips can be layered and played simultaneously.
You can give a fade effect when switching animation.


public apAnimPlayData Play ( string animClipName,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData Play ( apAnimPlayData animPlayData,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData PlayAt ( string animClipName,
                int frame,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData PlayAt ( apAnimPlayData animPlayData,
                int frame,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
1.1.6
Description

   Play the animation clip right away.
   Playback starts without waiting time or fade effect.
   The PlayAt function allows you to start playback at a specific frame.


Parameters

   string animClipName : Name of Animation clip
   apAnimPlayData animPlayData : Target animation data
   int frame : The frame you want to start in the PlayAt function
   int layer : Layer on which the animation plays (Default is 0)
   apAnimPlayUnit.BLEND_METHOD blendMethod : Layered animation blend method (Default is BLEND_METHOD.Interpolation)
   apAnimPlayManager.PLAY_OPTION playOption : How to end other animations that are playing (Default is PLAY_OPTION.StopSameLayer)
   bool isAutoEndIfNotloop : Whether to terminate automatically if an animation clip has no Loop option (Default is false)


Return

   apAnimPlayData : Data of animation clip being played (if no animation clip is requested, null)


public apAnimPlayData PlayQueued ( string animClipName,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData PlayQueued ( apAnimPlayData animPlayData,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData PlayQueuedAt ( string animClipName,
                int frame,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData PlayQueuedAt ( apAnimPlayData animPlayData,
                int frame,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
1.1.6
Description

   When the animation clip played on the currently requested layer ends, it plays immediately.
   If no animation is playing on the layer, playback will begin immediately.
   If the animation clip being played does not end with the Loop option, the function will not be processed and will be ignored.
   The PlayQueuedAt function allows you to start playback at a specific frame.


Parameters

   (Same as Play(), PlayAt() except PLAY_OPTION playOption)


Return

   apAnimPlayData : Data of animation clip being played (If the requested animation clip does not exist or is Loop, null)


public apAnimPlayData CrossFade ( string animClipName,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFade ( apAnimPlayData animPlayData,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFadeAt ( string animClipName,
                int frame,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFadeAt ( apAnimPlayData animPlayData,
                int frame,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                apAnimPlayManager.PLAY_OPTION playOption,
                bool isAutoEndIfNotloop )
1.1.6
Description

   Animation clips playback including fade effects.
   It is similar to the Play function, but with a fade effect as fadeTime, it starts slowly and naturally.
   The CrossFadeAt function allows you to start playback at a specific frame.


Parameters

   float fadeTime : The time at which the animated smoothly changing fade effect is applied (Default is 0.3f)
   (The rest is the same as the Play(), PlayAt())


Return

   apAnimPlayData : Data of animation clip being played (if no animation clip is requested, null)


public apAnimPlayData CrossFadeQueued ( string animClipName,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFadeQueued ( apAnimPlayData animPlayData,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFadeQueuedAt ( string animClipName,
                int frame,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
public apAnimPlayData CrossFadeQueuedAt ( apAnimPlayData animPlayData,
                int frame,
                float fadeTime,
                int layer,
                apAnimPlayUnit.BLEND_METHOD blendMethod,
                bool isAutoEndIfNotloop )
1.1.6
Description

   As with PlayQueued, when the animation being played ends, it plays continuously.
   The fade effect is added by fadeTime based on the end time and playback begins.
   The CrossFadeAt function allows you to start playback at a specific frame.


Parameters

   (Same as CrossFade(), CrossFadeAt() except PLAY_OPTION playOption)


Return

   apAnimPlayData : Data of animation clip being played (If the requested animation clip does not exist or is Loop, null)


public void StopLayer ( int layer, float fadeTime )
Description

   Stop all animations on the requested layer.


Parameters

   int layer : Layer to be stopped
   float fadeTime : Time at which the animation ends smoothly by fading (Default is 0)


public void StopAll ( float fadeTime )
Description

   Stop all animations.


Parameters

   float fadeTime : Time at which the animation ends smoothly by fading (Default is 0)


public void PauseLayer ( int layer )
Description

   Pause all animations in the requested layer.


Parameters

   int layer : Layer to be paused


public void PauseAll ()
Description

   Pause all animations.


public void ResumeLayer ( int layer )
Description

   Plays the paused animations of the requested layer again.


Parameters

   int layer : Layer to be resumed


public void ResumeAll ()
Description

   Plays all paused animations.


public bool IsPlaying ( string animClipName )
Description

   Queries if the animation clip you requested is playing.


Parameters

   string animClipName : Target animation clip name


Return

   bool : Returns true if the animation is playing (returns false if it is not playing or is not present)


public apAnimPlayManager PlayManager
Description

   The manager that plays the animation.
   Controls playback, stop, etc. from inside.
   You can refer to the animated clip information that is baked.
   
   public List<apAnimPlayData> PlayDataList : List containing animated clip information


public void RegistAnimationEventListener ( MonoBehaviour listenerObject )
Description

   Registers a listener to receive animation events.
   For more information on how to create and invoke animation events, see the related page.


Parameters

   MonoBehaviour listenerObject : The MonoBehaviour object from which the animation event will be invoked


public void SetAnimationSpeed ( string animClipName, float speed )
public void SetAnimationSpeed ( float speed )
1.1.0
Description

   Sets the playback speed of the animation.
   The default value is 1.0f, and you can also set a negative number.
   Like other functions, it does not work when using mecanim.
   If you do not specify animClipName, sets the speed of all animations.


Parameters

   string animClipName : The name of the animation clip for which you want to set the speed. Target all animation clips when not set
   float speed : Playback speed ratio. The default is 1.0f


public void ResetAnimationSpeed ()
Description

   Reverts the playback speed of all animations to their default values.


public List<apAnimPlayData> AnimationPlayDataList
1.1.2
Description

   Returns a list of apAnimPlayData with playback information for the animation.
   You can see the playable animation data directly.


Return

   List<apAnimPlayData> : A list of playable apAnimPlayData


public apAnimPlayData GetAnimationPlayData ( string animClipName )
1.1.2
Description

   Queries the apAnimPlayData object with animation playback information by name.


Parameters

   string animClipName : Target animation clip name


Return

   apAnimPlayData : A playable apAnimPlayData object. Return null if not


public apAnimPlayData.AnimationPlaybackStatus GetAnimationPlaybackStatus ( string animClipName )
1.1.2
Description

   Get the playback status of the animation by the name.
   The result value of "None, Playing, Paused, Ended" is returned in Enum format.
   Provides more granular state values than the IsPlaying () function.


Parameters

   string animClipName : Target animation clip name


Return

   apAnimPlayData.AnimationPlaybackStatus : The playback state of the animation