2using Microsoft.MixedReality.Toolkit.UI;
3using System.Collections.Generic;
10[RequireComponent(typeof(Animator))]
69 m_NoiseDataPanelTitle = GameObject.FindGameObjectWithTag(
"NoiseDataPanelTitle").GetComponent<TextMeshPro>();
119 if(
m_Animator.GetCurrentAnimatorStateInfo(0).IsName(
"Joel_PGN") )
123 else if(
m_Animator.GetCurrentAnimatorStateInfo(0).IsName(
"Joel_Iso") )
127 else if(
m_Animator.GetCurrentAnimatorStateInfo(0).IsName(
"Joel_WGN") )
131 else if(
m_Animator.GetCurrentAnimatorStateInfo(0).IsName(
"Idle") )
138 Debug.Log(
" Animation is unknown ");
163 " You covered required distance.",
true);
192 float animationLength = 0.0f;
195 if( isValidAnimLength && noiseValue != 0 )
197 desiredSpeed = ( animationLength / noiseValue );
201 m_Animator.speed = desiredSpeed;
204 float len =
m_Animator.GetCurrentAnimatorStateInfo(0).length;
216 AnimationClip[] clips =
m_Animator.runtimeAnimatorController.animationClips;
218 foreach( AnimationClip clip
in clips )
This class is used to control the avartar animation state.
void OpenConfirmationDialogMedium()
Opens confirmation dialog example
const float m_DefaultAnimationSpeed
Default value of animation speed.
TextMeshPro m_NoiseDataPanelTitle
This is also use as an error message display and current noise display.
string m_NoisePatternLbl
To identify the current noise pattern.
void RunGaitCycle()
Expand and Shrink gait cycle animation The completion time of animation is the value of pink or white...
void ApplyCorrectNoisePattern()
Get the calculated noise pattern and apply that to animation speed. This noise will shrink or expand ...
void Awake()
Gets called first when script is invoked Cached the references to Animator, SetNoise and NoiseDataPan...
Animator m_Animator
Reference to the animator
NoiseController m_NoiseController
Reference to NoiseController class.
int m_NoiseIndex
Noise index for traveling the noise list. At the end of the travel, it will be reset to 0.
void UnlockAnimation()
Unlock the animation after it played out. Mapped to animation event.
bool m_IdleElementFlag
When Avatar goes to Idle, m_NoiseIndex will increment by 1. This will omit the next noise value from ...
GameObject m_DialogPrefabMedium
UI confirmation pop-up panel.
void Update()
Gets called per each frame The CamMovementTracker singleton instance has speed and IsMoving Flags....
List< float > m_AnimationLength
This list stores timestamps of the animation length of the gait cycle.
void ResetNoiseAfterEnd(int noiseLength, string lbl)
When we reached to the end of the colred noise list, we looped back to the beginning.
List< float > AnimationLength
Property to get the Animation length (Read-Only)
bool m_IsAnimationLocked
This flag is used to lock down the animation till it played out.
int m_Counter
Use to apply previous noise after changing idle to moving.
void LockdownAnimation()
Lockdown the animation until it played out. Animation will unlock after it complete the current loop....
void StoreAnimationClipsLength()
Store the original animation clips values in a dictionary.
Dictionary< string, float > m_OriginalAnimationLength
This stores the length of the original gait cycle animations.
void ResetAnimationLengthList()
Called after user click cancel pattern button in Noise UI.
void Start()
Cached a reference to ScaledNoisePatterns class.
SetNoise m_SetNoise
Reference to the SetNoise Script.
bool NoiseAppliedFlag
Property to get noise applied flag (Read-Only)
List< float > NoiseValueList
Property to get colored noise distribution (Read-Only)
A singleton Instance to track Camera Movements This will also calculate distance, rotation and speed ...
static CamMovementTracker m_CamTrackerInstance
Singleton Instance We have 1 Camera instance and 1 User at all time. Therefore, I believe Singleton i...
bool IsMoving
Property to get and set IsMoving flag.
This class initiate appopriate noise objects.
This class is used to set noise pattern levels. When user press a button, it will change the pattern.
ColoredNoise GetNoisePattern()
Gettr to get the user's selection.