Author Topic: Tween CallWhenFinished not working :(  (Read 1778 times)

calaverax

  • Guest
Tween CallWhenFinished not working :(
« on: October 21, 2013, 12:50:56 PM »
Hi Everyone! i've just grabbed the free version of ngui to test if it suits for the current project i'm developing.

i'm having some issues on a tween for a button, i have on my splash screen a button "Start", when clicked i hide it, and show 3 buttons (Easy / Normal / Hard) and start his tweens to move it in a cascade.

The thing is that if i want to show it when the previus ended his tween, the callback is not working. never calls nothing.

and another thing. after the tween finished, the buttons dont respond to clicks, they stay there, still, and after like 5 or 6 seconds the start responding.

any help on this will be really apreciated.

this is my code:

  1.        
  2. void showDificulty()
  3.         {
  4.                 _startButton.SetActive(false);
  5.                
  6.                 _easyButton.SetActive(true);
  7.                 _normalButton.SetActive(true);
  8.                 _hardButton.SetActive(true);
  9.                
  10.                 _easyTween.from = _easyTween.position;
  11.                 _easyTween.duration = 0.8f;
  12.                 _easyTween.to = new Vector3(0,_startButton.transform.position.y - 50,0);
  13.                 _easyTween.Reset();
  14.                 _easyTween.callWhenFinished = "methodNotCallingNeverHere";
  15.                 _easyTween.enabled = true;
  16.                
  17.                 _normalTween.from = _normalTween.position;
  18.                 _normalTween.duration = 0.8f;
  19.                 _normalTween.to = new Vector3(0,_startButton.transform.position.y - 100,0);
  20.                 _normalTween.Reset();
  21.                 _normalTween.enabled = true;
  22.                
  23.                 _hardTween.from = _hardTween.position;
  24.                 _hardTween.duration = 0.8f;
  25.                 _hardTween.to = new Vector3(0,_startButton.transform.position.y - 150,0);
  26.                 _hardTween.Reset();
  27.                 _hardTween.enabled = true;
  28.         }
  29.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Tween CallWhenFinished not working :(
« Reply #1 on: October 21, 2013, 01:24:36 PM »
Free version of NGUI is extremely old -- a year and a half out of date -- and it doesn't come with support. That said, you need to use TweenPosition.Begin(...) instead of what you're doing. It will create the tween if it's missing, and will enable it if it's disabled.

calaverax

  • Guest
Re: Tween CallWhenFinished not working :(
« Reply #2 on: October 21, 2013, 01:29:12 PM »
Ok, thanks! i'll check it that way,

i'm using free version because i'm evaluating buying it, i think it suits my needs and much more.

Cheers!