Hi,
thank you for the fast reply.
Yes, I have looked at your example but but it uses animations which would be to much overhead for my project.
Using TweenPosition.Begin results in the same strange behavior. (The animation itself works as expected, but parts of the menu disapears)
Below the important parts.
public void doFadeOut(){
TweenPosition
.Begin(this.gameObject, 1f,
new Vector3
(-432,
-48,
0)); currentState = State.FADE_OUT;
}
public void doFadeIn(){
transform
.position = transform
.parent.TransformPoint(new Vector3
(432,
-48,
0)); NGUITools.SetActive(gameObject, true);
TweenPosition
.Begin(this.gameObject, 1f,
new Vector3
(0,
-48,
0)); currentState = State.FADE_IN;
}
// Started after the animation ends
public void performStateAfterFade(){
if(currentState == State.FADE_IN){
currentState = State.VISIBLE;
}else{
currentState = State.HIDDEN;
NGUITools.SetActive(gameObject, false);
}
}
Attached few images to makes it more clear.
Initial state first menu(1) is Active, 2nd menu(2) is Inactive.
[init.png] Initial screen after start.
[item_clicked.png] If an item was selected the method "doFadeOut" is started on the current menu(1) and "doFadeIn" on the next menu(2).
[back_toOverview.png] Pressing "Overview" Button triggers "doFadeOut" for the current one menu(2) and "doFadeIn" for the menu(1).
[item_clicked_again.png] Selcting another item from menu(1) does the same like in [item_clicked.png]. Starts method fadeOut on menu(1) and fadeIn on menu(2)
I had the same behavior in menu(1) also.
If I do not change the "from" or "to" of the current Tween items does not dissapear.
Thank you very much.