I have created an Image target to show my 3d character which has 2 animation on it. Can I use UnityGUI to create 2 button to trigger 2 different animations? For example, when touch the Button1 on the screen, my character jumps, and when touch Button2, my character runs.
Is the coding like this?
function OnGUI () {
if (GUI.Button (Rect (10,10,150,100), "Run")) {
animation["Run"].wrapMode = WrapMode.Loop;
animation.Play("Run");
}
}
http://unity3d.com/support/documentation/Manual/Character-Animation.html
http://unity3d.com/support/documentation/ScriptReference/Animation.html
- Kim