8 using System.Collections;
10 namespace Valve.VR.InteractionSystem
16 public Animator animator;
18 private float currentLinearMapping = float.NaN;
19 private int framesUnchanged = 0;
25 if ( animator == null )
27 animator = GetComponent<Animator>();
30 animator.speed = 0.0f;
32 if ( linearMapping == null )
34 linearMapping = GetComponent<LinearMapping>();
42 if ( currentLinearMapping != linearMapping.value )
44 currentLinearMapping = linearMapping.value;
45 animator.enabled =
true;
46 animator.Play( 0, 0, currentLinearMapping );
52 if ( framesUnchanged > 2 )
54 animator.enabled =
false;