Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Shorinji on June 22, 2012, 09:00:36 AM

Title: Why does popup list triggers in the Start function?
Post by: Shorinji on June 22, 2012, 09:00:36 AM
Hi,
I want to use a popup menu which contains a popup list.
When i launch my game, "Function Name" is called because inside Start(), "selection" is set to something.
Why did you choose this behavior to happen?
Thanks in advance.
Title: Re: Why does popup list triggers in the Start function?
Post by: ArenMook on June 22, 2012, 10:54:35 AM
The callback function is invoked in Start -- it's the same behaviour as other NGUI scripts -- checkbox, for example. This is for consistency purposes. The selected item is both highlighted, and whatever the callback is supposed to do also happens. For example if you loaded something from player prefs in awake and set the value of the popup list, and the callback function was changing the game map (and the game map texture), without this functionality the game map would never change to the selected value, which would be wrong.
Title: Re: Why does popup list triggers in the Start function?
Post by: Shorinji on June 23, 2012, 12:55:12 AM
Hi,
Actually after more tries, think this component doesn't really fit for what i need. I need something which would more look like a "pop up buttons list", no trigger at start, and trigger again even if the selected item is the same than the previously selected item. However it doesn't exist (or i did not see it).
So i have other questions.
From a license point of view, do i have the right to modify the scripts provided with NGUI? Do i have the right to make new components myself based on NGUI architecture?
Thanks.
Title: Re: Why does popup list triggers in the Start function?
Post by: ArenMook on June 23, 2012, 03:35:05 AM
Of course you can. I suggest creating new scripts / widgets rather than modifying existing ones though. It'll make updating easier.