Author Topic: UIPlayTween and UIToggle in 3.0.1 does not work.  (Read 3412 times)

7realm

  • Guest
UIPlayTween and UIToggle in 3.0.1 does not work.
« on: October 04, 2013, 12:51:07 AM »
Because we moved to event delegate system in NGUI 3.0.1, UIPlayTween now is not triggered by UIToggle, as it does not call OnActivate(bool) method.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #1 on: October 04, 2013, 01:59:14 AM »
What does UIPlayTween have to do with a UIToggle?

7realm

  • Guest
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #2 on: October 04, 2013, 02:09:43 AM »
UIPlayTween can be triggetered OnActivate event, that is sent by UICheckBox and legacy part of UIToggle. It will be nice to play tweens on UIToggle events.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #3 on: October 04, 2013, 02:12:07 AM »
UIToggle doesn't use UIPlayTween. It uses TweenAlpha.Begin on the activeSprite game object. If you have another alpha tween on the sprite, then there will be a conflict, obviously.

misc

  • Guest
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #4 on: October 22, 2013, 03:33:13 AM »
Dear Aren,

I have a similar issue: I want to upgrade a project, where I use a lot of checkboxes with attached UIButtonTween triggered by OnActivate.

Example NGUI 2.7x:
When activating the checkbox, the object linked to the UIButtonTween is enabled and the attached tween is played.
When deactivating the checkbox, the object plays the tween reverse and is disabled.

NGUI 3.x:
I replaced  UICheckbox by UIToggle and UIButtonTween by UIPlayTween (triggered by OnActivate).
Activating or deactivating the UIToggle does not seem to trigger the UIPlayTween component.

When sending OnActivate(bool) to the UIPlayTween object it works as expected.

I checked the "Example 2 - Interaction" scene. UIPlayTween works well with OnClick events. (p.s. you should update the text there).

Any idea what I can do?


Dover8

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 20
    • View Profile
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #5 on: April 01, 2014, 08:12:26 AM »
Any update on this? UIPlayTween is not triggered when set to OnActivate True/False and attached to a UIToggle. Nor is the void OnActivate method of UIPlayTween an appropriate delegate to be added to the OnValueChange delegate list of UIToggle.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPlayTween and UIToggle in 3.0.1 does not work.
« Reply #6 on: April 01, 2014, 10:00:36 AM »
There is no "OnActivate" anymore. The toggle itself has an "on change" notification you can set, and you can tell it to play a tween of your choice.