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 - bratchan

Pages: [1]
1
NGUI 3 Support / Re: NGUI and Server List
« on: March 05, 2014, 12:04:55 PM »
Ok, that isn't the issue i have the labels displaying but thanks for the better way of doing that.

I need help figure out when button is clicked grab that host data and connect with it. I'm having issues passing that data along with the buttons.

2
NGUI 3 Support / NGUI and Server List
« on: March 04, 2014, 11:09:53 AM »
I have been banging my head against a wall for a while. I hope someone might be able to help out with my issue. I’m still new to NGUI and I also have been working in javascript.

I am creating a Muliplayer game and need to get menus to work with NGUI. I have it all working find with the GUI system in unity, I just wanted it to easier to style and such.

I have hosting menu to work fine, you can connect to the server and its all good, its for the joining players where I have the issue at. I have NGUI populating a grid with a label and a button so you can click to join that server.

I can’t figure out how to get the host information for that certain server so you can connect to it.

This is the code i have for populating the list.
  1. for (var element in data)
  2.                 {
  3.                
  4.                         Debug.Log("loadElement");
  5.                         var name = element.gameName + " " + element.connectedPlayers + " / " + element.playerLimit;
  6.  
  7.                        
  8.                         Debug.Log(element);
  9.                
  10.                        
  11.                         NGUITools.AddChild(serverTable, serverItem);
  12.                         serverItem.GetComponent(UILabel).text = name;
  13.                         serverItem.name = rr.ToString();
  14.                         //Debug.Log(serverItem.name);
  15.                         Debug.Log(serverItem.GetComponent(UILabel).text);
  16.                        
  17.                         NGUITools.AddChild(serverTable, serverButton);
  18.                        
  19.                          //(serverButton as serverButtonRunner).myInfo = element;
  20.                          
  21.                          serverButton.GetComponent(serverButtonRunner).myInfo = "hbhhhh";
  22.                        
  23.                        
  24.                         //yield WaitForSeconds (.5);
  25.                         serverTable.GetComponent(UIGrid).Reposition();
  26.                  
  27.                                 Debug.Log("Connecting...");    
  28.                                
  29.                                 serverButton.SendMessage("receiveMessage", element, SendMessageOptions.DontRequireReceiver);   
  30.                        
  31.                         //create BTN here and the onclick
  32.                         //NGUITools.addChild();
  33.                         rr ++;
  34.                        
  35.                         //Network.Connect(element);


This is all the fail code i have on my button that hasn’t worked.
  1. var targetScript;
  2.  
  3. private var server:String;
  4.  
  5. public var myInfo;
  6.  
  7. function Awake () {
  8. //finds the script that runs the menu
  9.         var gameScript = GameObject.Find("menuRunner");
  10.        
  11.         targetScript = gameScript.GetComponent(menuRunner).serverInformation;
  12.         //Debug.Log(gameScript.GetComponent(menuRunner).serverInformation);
  13.         //targetScript = targetScript.ToString();
  14.  
  15. }//end of awake
  16.  
  17. //doesn't work
  18. function receiveMessage(passInfo){
  19.  
  20.         //testInfo = passInfo;
  21.        
  22.         //Network.Connect(testInfo);
  23.         //no output
  24.         Debug.Log("workihghfdfhjkhfhfghjkhfdfghjng");
  25.  
  26. }//end of test
  27.  
  28. function OnClick(){
  29. Debug.Log(targetScript);
  30.         Debug.Log("clck");
  31.         //this doesn't work
  32.         //Network.Connect(targetScript);
  33.         //Debug.Log("Connecting...");  
  34.  
  35. }//end of onclick

Anything or suggestions would be grateful.

3
NGUI 3 Support / Re: Newbie- Load up Unity to work again and now errors
« on: December 23, 2013, 04:29:48 PM »
I don't see it. Even when i try to re import it it doesn't exist and i don't know why.

this is for re import opens for UI I don't even see an option for it
http://gyazo.com/cb80425890f63ef23a538437de0344a0

4
NGUI 3 Support / Newbie- Load up Unity to work again and now errors
« on: December 23, 2013, 12:06:26 PM »
I have a bought version of nGUI. Using the current version of nGUI and using Unity 4.3.1f1. I am working in Javascript i moved the files into the Plugins. Everything was working fine. I have a couple of menus already made and programmed. i had closed and reopened it a few times, no errors. I go and open it today I have all sorts of errors and i have no clue why namespace names are now missing. I have re imported and moved the files, but still errors.

I had errors that were animationortween  i had to individually import them and they started to work. I have no clue why they stopped working. I fixed those but now i have 7 errors that all are missing the namespace name "UIAtlas". I am not seeing it in the import so I'm not sure where this file is so i can fix this issue.

Assets/Plugins/NGUI/Interaction/UIPopupList.cs(36,16): error CS0246: The type or namespace name `UIAtlas' could not be found. Are you missing a using directive or an assembly reference?

etc.




Pages: [1]