using UnityEngine;
using System.Collections;
public class animationCtrl : MonoBehaviour {
private float hSliderValue;
private AnimationState currentAni;
void Start () {
gameObject.animation.Play("shot");
gameObject.animation.Stop();
currentAni = animation["shot"];
}
void LateUpdate () {
currentAni.time = hSliderValue;
currentAni.enabled = true;
animation.Sample();
currentAni.enabled = false;
}
void OnGUI() {
hSliderValue = GUILayout.HorizontalSlider(hSliderValue, 0.0f, currentAni.length, GUILayout.Width(100));
}
}