Hi,
For this game we need to have different windows pop up at the same time so I wrote this script.
I would like the text in the windows to be variables so I used a function because it will make it a lot easier and more simple.
also I realize that all of the windows will appear on top of each other. I will change the position of the windows after all the errors are fixed.
This is my javascript…
#pragma strict
var shipWindow = function (shipname, shipPrice, length, width, spacingX, spacingY, damage, health, speed, summary)
{
function () OnGUI; {
(GUI.Button (Rect (length,width,spacingX,spacingY), shipName))
{
GUI.Box (Rect (Screen.width - 100,0,100,50), print (shipName) )
GUI.Box (Rect (Screen.width - 100,0,100,50), print (shipPrice) )
GUI.Box (Rect (Screen.width - 100,0,100,50), print ("Damage :" " " damage) )
GUI.Box (Rect (Screen.width - 100,0,100,50), print ("Health :" " " health) )
GUI.Box (Rect (Screen.width - 100,0,100,50), print ("speed :" " " speed) )
GUI.Box (Rect (Screen.width - 100,0,100,50), print ("summary :" " " print) )
}
}
};
The script is going to be used for a store menu where you can purchase different ships.
I get this error
Assets/My Scripts/ShipPurchaseWindow.js(9,18): BCE0044: expecting :, found '{'.
And I am not sure what to do.
Any help is great,
Thank You