soundvision/UnityProject/Assets/Scenes/Examples/MIDI/script/OrangeCube.cs
2019-11-01 13:33:23 +01:00

25 lines
630 B
C#

using UnityEngine;
namespace cylvester
{
public class OrangeCube : MonoBehaviour
{
[SerializeField] private Animator anim;
private float speed_ = 1.0f;
private static readonly int Moving = Animator.StringToHash("Moving");
private bool trigger_;
public void OnTriggerReceived()
{
anim.speed = speed_;
anim.SetBool(Moving, false);
anim.SetBool(Moving, true);
}
public void OnStateChanged(IStateReader currentState)
{
speed_ = currentState.CurrentState.Speed;
}
}
}