Don't like ads? PRO users don't see any ads ;-)

Unity Decision Maker

By: vjanomolee on Jun 19th, 2012  |  syntax: JavaScript  |  size: 0.66 KB  |  hits: 40  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Decision Maker
  2.  
  3. //Notes: Bonus: options for not repeating chosen phrases
  4.  
  5. function Update ()
  6. {
  7.  
  8. }
  9.  
  10. function OnGUI ()
  11. {
  12.         if(GUI.Button (Rect(10,30,80,30), "Upload list file (.txt)"))
  13.         {
  14.                 // 1. show OS file browser with "import" button.
  15.                 // 2. if (import button is pressed after user chooses file with appropriate extension)- upload file and display list of phrases clearly seperated
  16.                 // 3. after successful import, show "Choose for me" button
  17.                 // 4. if ("Choose for me" button is pressed )-  animate / jumble all of the phrases
  18.                 // 5. wait a few seconds for animation to complete and then highlight/ show the randomly chosen phrase and play sound.
  19.         }
  20. }