AvatarReady
Loading...
Searching...
No Matches
Inria.Avatar.AvatarReady.AnimationJsonPlayer Class Reference

Player for avatar animations json files. Path must be in animation json folder. More...

Inheritance diagram for Inria.Avatar.AvatarReady.AnimationJsonPlayer:
Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer

Public Member Functions

 AnimationJsonPlayer (string path, Animator animator)
 
override void UpdatePose (float deltaTime=0)
 
override void ClearAnimation ()
 
override float GetDuration ()
 
override float GetCurrentTime ()
 
override void SetCurrentTime (float time)
 
override void PauseAnimation ()
 
- Public Member Functions inherited from Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer
 AvatarReadyAnimationPlayer (string path, Animator animator)
 Create a player for a type of animation.
 
virtual void PlayAnimation (bool fromStart=true)
 Check if animation is ready to play and start playing.
 
virtual void UpdateAnimation ()
 Called every frame.
 
void UpdatePose (float deltaTime=0)
 Update pose of the avatar. If logic needs to run every frame while the animation is playing, set it here.
 
void ClearAnimation ()
 Called before ending the player. Is called when on behaviour's OnDisable or when player is changed.
 
float GetDuration ()
 Get duration of the Animation.
 
float GetCurrentTime ()
 Get current time of the animation.
 
void SetCurrentTime (float time)
 Set the current time of the animation.
 
void PauseAnimation ()
 Pause the animation being played.
 

Protected Member Functions

override bool SetupAnimation ()
 
override void LoopAnimation ()
 
override void SetAnimationAtStart ()
 
- Protected Member Functions inherited from Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer
bool SetupAnimation ()
 Fetch animation asset and get things ready for play.
 
void SetAnimationAtStart ()
 Set the animation at start.
 
void LoopAnimation ()
 Check if animation has finished and/or set animation at start.
 

Properties

ClipInfo CurrentClipInfo [get]
 
- Properties inherited from Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer
string Path [get]
 

Private Member Functions

bool CheckPath ()
 
void ReadAnimation ()
 Open and parse the json file.
 
StreamReader OpenFile ()
 Check if the file exists and create a stream reader to read the file.
 
void LoadJson (StreamReader file)
 Create clip info from json file.
 
void ParseClipInfo (ClipInfo clipInfo)
 Create animation curves from Clip info.
 

Private Attributes

ClipInfo currentClipInfo
 
AnimationCurve[] muscleCurves
 
AnimationCurve[] positionCurves
 
AnimationCurve[] rotationCurves
 
HumanPoseHandler poseHandler
 
HumanPose pose
 
float currentTime
 
float duration
 

Additional Inherited Members

- Public Attributes inherited from Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer
bool IsInitialized
 
bool IsPlaying
 
bool IsLoop
 
- Protected Attributes inherited from Inria.Avatar.AvatarReady.AvatarReadyAnimationPlayer
string path
 
Animator animator
 

Detailed Description

Player for avatar animations json files. Path must be in animation json folder.

Member Function Documentation

◆ OpenFile()

StreamReader Inria.Avatar.AvatarReady.AnimationJsonPlayer.OpenFile ( )
inlineprivate

Check if the file exists and create a stream reader to read the file.

Returns
Stream reader for the animation file
Exceptions
ArgumentExceptionThrown when the file can't be found

The documentation for this class was generated from the following file: