2019-11-01 10:41:06 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace cylvester
|
|
|
|
|
{
|
|
|
|
|
public class OrangeCube : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[SerializeField] private Animator anim;
|
2019-11-01 12:33:23 +00:00
|
|
|
|
private float speed_ = 1.0f;
|
2019-11-01 14:38:30 +00:00
|
|
|
|
private static readonly int OrangeBoxAnimation1 = Animator.StringToHash("OrangeBoxAnimation1");
|
2019-11-01 12:33:23 +00:00
|
|
|
|
private bool trigger_;
|
|
|
|
|
|
2019-11-01 10:41:06 +00:00
|
|
|
|
public void OnTriggerReceived()
|
|
|
|
|
{
|
2019-11-01 12:33:23 +00:00
|
|
|
|
anim.speed = speed_;
|
2019-11-01 14:38:30 +00:00
|
|
|
|
anim.Play(OrangeBoxAnimation1, -1, 0f);
|
2019-11-01 12:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnStateChanged(IStateReader currentState)
|
|
|
|
|
{
|
|
|
|
|
speed_ = currentState.CurrentState.Speed;
|
2019-11-01 10:41:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|