Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: AngryGerman on August 26, 2013, 05:42:30 PM
-
Aren,
you were so kind to agree to include a change request by me a couple days ago - http://www.tasharen.com/forum/index.php?topic=5473.msg26012#msg26012
Could I make another request/suggestion?
In our project I need to move a draggable panel to a given GO in a dynamic created list of entries by giving the CenterOnChild script a specific GameObject. Using your UICenterOnChild script I achieved this by adjusting the script to accept an optional parameter. If it's not too much to ask, could that be included in a future release ?
thanks,
-
Aren,
you were so kind to agree to include a change request by me a couple days ago - http://www.tasharen.com/forum/index.php?topic=5473.msg26012#msg26012
Could I make another request/suggestion?
In our project I need to move a draggable panel to a given GO in a dynamic created list of entries by giving the CenterOnChild script a specific GameObject. Using your UICenterOnChild script I achieved this by adjusting the script to accept an optional parameter. If it's not too much to ask, could that be included in a future release ?
thanks,
So what exactly would the method for executing this script be AngryGerman?
1. Attach the script to the container of your options (draggable contents). I will call my container "TestContainer"
2. CAll TestContainer.Recenter(ObjectToCenterOn);
Is that it? I'm trying to do something similar and would love your help.
-
Why not just do gameObject.transform.position? CenterOnChild goes to a position, does it not?
-
So what exactly would the method for executing this script be AngryGerman?
1. Attach the script to the container of your options (draggable contents). I will call my container "TestContainer"
2. CAll TestContainer.Recenter(ObjectToCenterOn);
Is that it? I'm trying to do something similar and would love your help.
@Donkey:
1.)
CenterOnChild is on the same GO in the Hierarchy as the UIGrid which is a child of the GO that contains the DraggablePanel, so:
DraggablePanel
|
-> UIGrid
UICenterOnChild
2.)
call Recenter(yourGO) with a reference to UICenterOnChild
e.g.: centerOnChild.Recenter(yourGO); (or adjusted to Aren's suggestion)
Why not just do gameObject.transform.position? CenterOnChild goes to a position, does it not?
@Aren: you mean passing in a GO's position, rather than a GO as a whole if I understand you correctly? Would work too, but then I have to type (go.transform.position) for every call to Recenter(). I can save myself that by passing the whole GO and dig down into the position inside the function :)
-
Yes but it would still have to go by position inside, so saving a few extra characters isn't worth adding an extra function for.
-
my proposal added an optional parameter to the existing function. Wasn't asking for an additional one. Unless I'm missing something in our conversation
-
what's the status of this? I would like to be able to pass an item to center on as well.
-
Add a helper function for it if you need it. I don't see the benefit of adding an extra function just to save having to type .transform.position. I prefer to keep it clean with a single function.