Hi there I'm writing an app using Unity extention but I've been stocked a couple of days with Unity animations, basically i want to start an animation at a OnButtonPressed from my Virtual Buttons, and at the end of it i want to do something else
something like:
gameobj.animation.Play("anim");
doSomething();
But the second line is executed before animation finish..
So I have a code calling java methods, something like this:
public void OnButtonPressed(VirtualButtonBehaviour vb)
{
AndroidJavaClass jc = new AndroidJavaClass("com.company.app.class");
AndroidJavaObject jo = jc.GetStatic
switch (vb.VirtualButtonName)
{
case "btn1":
gameobj.animation.Play("anim");
jo.Call("javamethod");
gameobj.animation.Play("anim2");
break;
}
}
////////////////////////
but my java method is executed immediately, also if I comment that line it would play immediately anim2..
I've tried lots of thing to validate when anim1 finish but none of them have worked for example
while (gameobj.animation.["anim"].time
{ }
gameobj.animation.Play("anim2");
It would be grate some help on this please :S
Hi there, thanks for all your help, I've tried those things but you have just give me a key factor, I'm doing this on my VB class maybe I should create a script onto my gameobj and also try placing the condition in the update method so it checks every frame instead of codding directly into my VB class, i will try this out.
thanks a lot