1
NGUI 3 Support / Re: Controlling Animations with a slider
« on: April 23, 2014, 01:42:31 AM »
Im also having a problem with linking animation with ui slider, im new to coding all together.
I know using the gui in unity you use this on the object that has the animation, but what would you do for the ngui slider?
I know using the gui in unity you use this on the object that has the animation, but what would you do for the ngui slider?
- public class slidertest : MonoBehaviour {
- private AnimationState myanim;
- public float hSliderValue = 0.0F;
- // Use this for initialization
- void Start () {
- myanim = animation ["anim"];
- }
- // Update is called once per frame
- void Update () {
- }
- void LateUpdate(){
- myanim.time = hSliderValue;
- myanim.enabled = true;
- animation.Sample ();
- myanim.enabled = false;
- }
- void OnGUI() {
- }
- }
