For recreate the bug in simple condition, I created a little exemple :
Problem :I have a simple window with one button. when I click the button, a popup window appear with a scale and alpha animation (tweens).
This popup window have a button too, to close him with animation too.
It works perfectly on unity editor and web player. But it doesnt work on android whith my phone the first time I pop the window.
The first time the windows pop without anim, or the anim is very laggy.
After all is ok (I can close, open, after always ok).
So in my complete game there is an ugly menu bug at begin.
I made a rar with the scene and the script (attached file) or a description :The main window have : a Widget, with a child : Sprite ,with a child : button : with a child : label
The popup window have : a Widget, with a child : Sprite ,with a child : button : with a child : label
the popup window have his game object disabled at begin.
the popup window Widget have one tween scale and one tween alpha.
I created a game object with script : MenuManager :
Code :
using UnityEngine;
using System.Collections;
public class MenuManager : MonoBehaviour
{
public UIWidget _popupWindow;
void Update()
{
if ( Input.GetKey(KeyCode.Escape) == true )
{
Application.Quit();
}
}
public void pop()
{
_popupWindow.gameObject.SetActive(true);
TweenAlpha ta1 = (TweenAlpha)_popupWindow.gameObject.GetComponent("TweenAlpha");
ta1.PlayForward();
TweenScale ta2 = (TweenScale)_popupWindow.gameObject.GetComponent("TweenScale");
ta2.PlayForward();
}
public void drop()
{
TweenAlpha ta1 = (TweenAlpha)_popupWindow.gameObject.GetComponent("TweenAlpha");
ta1.PlayReverse();
TweenScale ta2 = (TweenScale)_popupWindow.gameObject.GetComponent("TweenScale");
ta2.PlayReverse();
}
}
The main window button call "pop()"
The popup window button call "drop()"
I use NGUI 3.5.4 r2
and Unity 4.3.4f1
My phone is Galaxy SIII mini
Is there an other solution or a workaround to fix it ?
thanks