Author Topic: What is the best way for to do....  (Read 14766 times)

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #15 on: September 02, 2014, 02:25:35 PM »
I may have a solution, but I will need more time to test its effects -- meaning I need to be home first. I'm currently on vacation, meaning away from my main PC.
Ok no problem I just wanted report you this bug. I can wait you

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #16 on: September 08, 2014, 05:16:08 PM »
Hi Aren ! Do you remember to verify for this bug?

Thank you

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #17 on: September 08, 2014, 10:48:01 PM »
Yeah, it's fixed in the Pro version so you'll find it in the next update.

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #18 on: September 08, 2014, 11:55:14 PM »
Yeah, it's fixed in the Pro version so you'll find it in the next update.
Ok thank you !  When do  you release the next update?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #19 on: September 10, 2014, 12:37:58 AM »
It'll be this week, Saturday at the latest.

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #20 on: September 16, 2014, 11:54:03 AM »
Hi, the version 3.7.2 not solve the problem... this is the situation :

1. New scene.
2. Two sprites, one with a TweenColor on it that makes the sprite red. Another sprite has a UIPlayTween on it and a collider.
3. The UIPlayTween references the object with the TweenColor on it.
4. TweenColor is turned ON and GameObject is enabled and visible
5. UIPlayTween is set to play OnClick, Play Direction REVERSE, If target is disabled ENABLE THEN PLAY, If already playing RESTART IF NOT PLAYING and When finished DISABLE AFTER REVERSE.

Now I hit Play, the color of sprite changes automatically to red, click on the sprite with the UIPlayTween but the the red sprite is disabled before tween reverse you can see that the red sprite is disabled before the tween reverse start and before it is completed

This is the video http://youtu.be/1zN4ba2SGI4
« Last Edit: September 17, 2014, 02:50:13 AM by mimmog »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #21 on: September 17, 2014, 11:39:10 AM »
You don't have 3.7.2. If you had 3.7.2, you wouldn't see "If already playing" field anymore. It's gone. "On Activation" has taken its place.

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #22 on: October 01, 2014, 07:35:22 AM »
Ok now is good ! but there is another problem...when I hit Play, the sprite's color change automatically to red, then when I click on the sprite with the UIPlayTween the red sprite is disabled after tween reverse (now it's good!!) but the tween after reverse must be reenabled because if I reenable the old red sprite it must repeat the forward tween because else if I must re-display the menu I must always reset all tweens via script and it's no good for the performance...

Example :
1) Click on Play
2) Sprite change color to red
3) Click on button with UIPlayTween
4) Sprite change color to original (tween reverse) and it's disabled
5) If I reenable the sprite I don't see the change color to red such as at the second  point
« Last Edit: October 01, 2014, 07:46:30 AM by mimmog »

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #23 on: October 02, 2014, 03:30:17 PM »
What do you think about this problem ArenMook?  Can you solve it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #24 on: October 02, 2014, 11:00:42 PM »
I have a hard time understanding what you mean there. Can you give me a step by step instruction on how to re-create the new issue from scratch?

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #25 on: October 03, 2014, 06:27:03 AM »
Ok...look this video http://youtu.be/h3L_J1Y6zl0

1) I click Play
2) Menu is showed
3) I Click "OK" button (tween reverse and Menu is disabled after revers and it's ok!)

Attached to UIRoot I have this code for to show the menu after 1 second.  :
  1. void Start () {
  2.                 Invoke("startMenuInvoke", 1);
  3.         }
  4.  
  5.         void Update(){
  6.                 if (repeat) {
  7.                         NGUITools.SetActive(Menu, true);
  8.                         repeat = false;
  9.                 }
  10.         }
  11.        
  12.         // Update is called once per frame
  13.         void startMenuInvoke () {
  14.                 NGUITools.SetActive(Menu, true);
  15.         }
  16.  
  17.         public void repeatVar(){
  18.                 repeat = true;
  19.         }
Attached to "OK button" I have this code where into OnClick method I call "r" method that change the "repeat" bool var for to restart the menu when I click OK button and the tween reverse is finished

  1.         void Start () {
  2.                 ui = GetComponent<UIPlayTween> ();
  3.                 sMenu = root.GetComponent<startMenu> ();
  4.         }
  5.  
  6.  
  7.         void OnClick(){
  8.                 EventDelegate.Set(ui.onFinished,r);
  9.         }
  10.  
  11.         void r(){
  12.                 sMenu.repeat = true;
  13.         }

If I click on OK button the tween must reverse and when finish the menu must be reenabled and tween must go forward such as when I clicked Play for the first time but it's not as...
I think that the problem is that the tween reverse but it is not resetted to the original state, I must do it via script instead I think that the tween after reverse must be automatically resetted to original state and it should be again ready for tween forward :


O
R
I
G
I
N
A


     tween forward  --->>>>
    <<<<--- tween reverse (must came back to the original state!!)

S
T
A
T
E   
 
« Last Edit: October 03, 2014, 02:13:58 PM by mimmog »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #26 on: October 04, 2014, 07:48:32 AM »
Tweens aren't reset to original state after they complete. They remain in whatever state they ended in. So if you tween something from A to B, at the end it will remain in "B" state. If you want to reset them, do tween.ResetToBeginning() in a callback set to tween.onFinished.

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #27 on: October 04, 2014, 07:55:21 AM »
Tweens aren't reset to original state after they complete. They remain in whatever state they ended in. So if you tween something from A to B, at the end it will remain in "B" state. If you want to reset them, do tween.ResetToBeginning() in a callback set to tween.onFinished.
Yes I know it but why you not insert an option into menu editor ? so you do not necessarily have to create an script only for to do it...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: What is the best way for to do....
« Reply #28 on: October 04, 2014, 08:05:29 AM »
Eh. You see the OnFinished section on the tween? Drag & drop the tween's game object here. Now select the ResetToBeginning function.

Done, no need to write a script. ;)

mimmog

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: What is the best way for to do....
« Reply #29 on: October 04, 2014, 09:15:41 AM »
Eh. You see the OnFinished section on the tween? Drag & drop the tween's game object here. Now select the ResetToBeginning function.

Done, no need to write a script. ;)

Ok! I will try ! Thank you ;-)