Author Topic: Trying to understand menu swap  (Read 2071 times)

Bradamante3D

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 79
    • View Profile
Trying to understand menu swap
« on: June 02, 2013, 10:18:20 PM »
Hi,
I am studying the NGUI examples and have a bit of trouble understanding them. In the Main Menu example and the interaction example you're are both swapping out content, i.e. moving them around. In the Main Menu you use animation, in Interaction a tween. I understand that part, but I don't see how you activate them from the Outside.

There's no script saying
  1. OnActivation
  2. this.GetTween().Start()

or

  1. OnClick
  2. target.GetAnimation("Name").StartOnce()

Know what I mean? How do you start them from the outside? Must happen somewhere in the Inspector, so I'm kinda frustrated I don't see it :(
#301224014, #301432336, #302399130

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trying to understand menu swap
« Reply #1 on: June 03, 2013, 12:37:01 AM »
UIButtonTween script on the button points to the remote tween.

Bradamante3D

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 79
    • View Profile
Re: Trying to understand menu swap
« Reply #2 on: June 03, 2013, 02:07:57 PM »
Uh OK looking at the code I see it.

The target is a GameObject and you get all tweens via

  1. go.GetComponentsInChildren<UITweener>()

and TweenTransform inherits from UITweener.
#301224014, #301432336, #302399130