Quantcast
Channel: Questions in topic: "javascripting"
Viewing all articles
Browse latest Browse all 105

How I can find the complete event of my animation

$
0
0
I am creating a demo in which I play two animation one is default which always run in background and one is when I clicked on my button. I want my default animation stops until my clicked animation not completed and when my clicked animation is complete i will play my default animation again. using UnityEngine; using System.Collections; public class hump_movement : MonoBehaviour { // Use this for initialization public GUITexture humpbutton; public AnimationClip humpanim; public AnimationClip idle; public bool myvar= false; void Start () { } // Update is called once per frame void Update () { if (Input.GetMouseButton (0) && humpbutton.HitTest (Input.mousePosition)) { animation.Play(humpanim.name); Debug.Log("1"); } else if(!Input.GetMouseButton (0) && humpbutton.HitTest (Input.mousePosition)){ animation.Play (idle.name); Debug.Log("2"); } } }

Viewing all articles
Browse latest Browse all 105

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>