|
I put this script in the Button and Cube to Play the Cube animation when the button be touched, is a touch button script. What is Wrong, is not working. _________________________________________________________________________ var btnTexture : Texture; function OnGUI() { if (!btnTexture) { Debug.LogError("Please assign a texture on the inspector"); return; } if (GUI.Button(Rect(10,10,50,50),btnTexture)) Debug.Log("Clicked the button with an image"); animation["Play"].speed= 1.0; animation.Play("Play"); } function ResetAnimation(curAnim : AnimationState) { yield WaitForSeconds(curAnim.length); animation.Play("Idle"); } ________________________________________________________________________
(comments are locked)
|

