Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Paul1

Pages: [1]
1
NGUI 3 Support / Re: How to Refresh UIGrid via code?
« on: August 19, 2014, 08:34:16 AM »
I love you!   ;D

2
NGUI 3 Support / How to Refresh UIGrid via code?
« on: August 17, 2014, 09:07:12 PM »
I have a function in a script that loops over a List, based on the contents decides whether to .SetActive (true)  or   .SetActive (false) icons in my UIGrid hiding the ones that should not be displayed and revealing others.

When the loop finishes I'd like to trigger the alphabetical sorting of the Grid to remove the blank spaces left behind by the inactive icons

Is there a function I can call in code to trigger this  (like right clicking on the UIGrid Script component in the inspector and selecting execute)

Thanks in advance!  :)

3
Thanks for the help again, I've checked and I did have the correct object assigned in the inspector, "but_food_l" has the TweenPosition script attached to it

I still get the same error      BCE0005: Unknown identifier: 'UITweener'.

I'm still struggling to identify where the problem actually is?

Is it because...
-My syntax is incorrect?
-I'm trying to access a C# script from a JS script?
-It's a compile order problem like mentioned here? http://answers.unity3d.com/questions/510862/bce0018-the-name-tweenposition-does-not-denote-a-v.html

I've tried to implement many solutions but they each seem to have their own dead ends, I'm not really sure where to go from here?



  1. #pragma strict
  2.  
  3. var mybutton:GameObject;
  4.  
  5. function Start () {
  6.  
  7.         mybutton = GameObject.Find("but_food_l");
  8.  
  9. }
  10.  
  11.  
  12. function ManageNGUIEnter() {
  13.  
  14.         Debug.Log("manage NGUI entering room");
  15.  
  16.         mybutton = mybutton.GetComponent(UITweener)().PlayForward();
  17.  
  18. }
  19.  
  20.  

4
Thank you for the help, I've been trying to test the code snippet in (what I think is) it's simplest form but get unexpected token errors.  This code is in a script on a different game object.

I don't think I understand how UITweener should be accessed?   :)

  1. var mybutton:GameObject;
  2.  
  3. function ManageNGUIEnter() {
  4.  
  5.         Debug.Log("manage NGUI entering room");
  6.  
  7.         mybutton = mybutton.GetComponent<UITweener>().PlayForward();
  8.        
  9. }
  10.  


I thought it maybe the syntax so I changed <UITweener>  to (UITweener)    but this produces the error unknown identifier: 'UITweener'

Any ideas?

Thanks again in advance


5
Hi I've recently purchased NGUI and would first like to say thanks for such a great time saving efficient tool 8-)

I'm fairly new to programming and am only familiar with Unity's Javascript, so not sure if this is a NGUI or Unity question

I'm trying to integrate NGUI in to a game I'm making. I've been stuck on this problem for a couple of days now so help would be greatly appreciated

As my character moves around a house I want to hide and reveal different ui buttons and graphics dependant on the room they are in. I'm using the NGUI Tween Position script attached to the button to move the item (I note that enabling this script via the inspector check box gives the desired result) . 

The Problem is I can't find a way to enable this tween or reverse it via a custom function I call when the character exits or enters a room.

Could anyone advise? (with code snippets or an example if possible as I'm quite junior when it comes to programming)

Thanks in advance  ;D



Pages: [1]