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

Pages: [1]
1
NGUI 3 Support / Lost download link
« on: February 04, 2014, 03:13:21 AM »
Hello, I've lost my link for the ngui download. Could you send me one over? (ross at howgarth.co.uk)

Thanks

2
Right okay, the main problem I have at the moment I suppose then is separating the records from the sql query. I'll stick it on unity answers since that isn't really specific to NGUI!

3
What I'm trying to accomplish here is for a list of aircraft to be downloaded from a database and then for each record to be presented for the user to click. The part I am struggling with is separating each record so it can be used on it's own. All I have currently is two scripts, one php script that queries the database and returns the string of aircraft + attributes:

  1. <?php
  2.     // Configuration
  3.     $hostname = 'myhost';
  4.     $username = 'myusername';
  5.     $password = 'mypassword';
  6.     $database = 'mydatabase';
  7.  
  8.     try {
  9.         $dbh = new PDO('mysql:host='. $hostname .';dbname='. $database, $username, $password);
  10.     } catch(PDOException $e) {
  11.         echo '<h1>An error has occurred.</h1><pre>', $e->getMessage() ,'</pre>';
  12.     }
  13.  
  14.     $sth = $dbh->query('    SELECT * FROM aircraft ORDER BY cost DESC LIMIT 5');
  15.     $sth->setFetchMode(PDO::FETCH_ASSOC);
  16.  
  17.     $result = $sth->fetchAll();
  18.  
  19.     if(count($result) > 0) {
  20.         foreach($result as $r) {
  21.             echo $r['manufac'], " ", $r['model'], " ", $r['cost'], "\n";
  22.         }
  23.     }
  24. ?>
  25.  

And I also have a controller:

  1. public class aircraftDownloader : MonoBehaviour
  2. {
  3.     private string secretKey = "#############";
  4.     public string getAircraftURL = "http://cowcatcher.net/am/display.php";
  5.         public UILabel aircraftlabel;
  6.     void Start()
  7.     {
  8.         StartCoroutine(GetScores());
  9.     }
  10.  
  11.     // remember to use StartCoroutine when calling this function!
  12.     IEnumerator GetScores()
  13.     {
  14.         aircraftlabel.text = "Loading Aircraft Data";
  15.         WWW hs_get = new WWW(getAircraftURL);
  16.         yield return hs_get;
  17.  
  18.         if (hs_get.error != null)
  19.         {
  20.             print("There was an error getting the high score: " + hs_get.error);
  21.         }
  22.         else
  23.         {
  24.             aircraftlabel.text = hs_get.text;
  25.         }
  26.     }
  27.  
  28. }
  29.  

At the moment, all this does is display each record on a new line on a single label. I need some way of seperating each downloaded record so I can use them in separate NGUI buttons/elements. After that I was considering displaying each in a table type format, what's the best way of doing this?

Thanks!

4
NGUI 3 Support / Re: Enabling Object after disable
« on: October 16, 2013, 01:49:33 PM »
I already have this. I want to be able to start the scene with all panels hidden and to do this I have been unchecking the box in the editor on the object for showing/hiding. When I use the NGUITools.SetActive(newairline, true); It won't show it?

5
NGUI 3 Support / Enabling Object after disable
« on: October 16, 2013, 10:26:56 AM »
Hello, I'm trying to manage enabling and disabling panels in my UI. So  I am able to disable using:
NGUITools.SetActive(GameObject.FindWithTag("newairlinepanel") as GameObject, false); and also
NGUITools.SetActive(newairlinepanel, false); using a predefined gameobject and dragging it on.

But I cannot enable in the same way. I understand that I need to keep a reference to the panel I am disabling, how do I go about this? Heres my hierarchy, the panels I'm interested in are the children of manager_panel



6
NGUI 3 Support / Re: Linking Input to Button
« on: October 07, 2013, 11:59:29 AM »
Cool, this looks like its working however I think because I am using the free version .value is not working? if so is there a way around it? I plan to update to the full version soon but for now it would be useful to have it working!

7
NGUI 3 Support / Linking Input to Button
« on: October 06, 2013, 08:34:49 AM »
Hello, I'm new to NGUI  and Unity in general. I really like what I see with NGUI and I'm trying to sort out profiles for a game I'm developing but I am having problems. Basically what I wan't is for my Inputs from two text boxes to be sent to my create new profile script when a button is pressed. Currently I have a script on each input that reads content of each input, I was then trying to reference them using get component from my create profile but I'm struggling to do so. I feel like I'm missing a trick here! :)

Pages: [1]