I'm trying to tie up my animation to a slider. When I play, the slider length should be that of my animation and when I drag the slider, it should play the appropriate part of the animation.
However, I'm having some real issues doing this.
This is what I have so far
public AnimationClip animation1;
public UISlider slider;
// Use this for initialization
void Start ()
{
anim.clip = animation1;
anim.Play();
float animationLength = slider.value * animation1.length;
slider.value = animationLength;
}
But this is wrong. Could someone please help me out?