The first thing all
Again I am a complete novice at Unity so let's have a play together and see where we get...
1. Fire up Unity - a huge demo seems to load up for me. Far too complicated for beginners so let's ditch that.
2. MENU - File -> New Project....
3. Browse to somewhere you want to put your files and call the file "HelloWorld" - so something like
"C:\Users\myusername\Documents\HelloWorld". Click Create.
4. MENU - GameObject -> Create Empty (WOW!)
5. In the Project Pane click the "Create" button and drop down to "JavaScript". A script name will appear.
6. Drag the script name onto the GameObject in the Hierarchy pane. This associates the Game Object with the script.
7. Open up the script i.e double click it. And enter the following....
function OnGUI () {
// Make a background box
GUI.Box (Rect (10,10,100,40), "Hello World!");
}
8.Best to save things now... MENU - FILE -> SAVE SCENE AS then call your scene something like "helloScene1"
9. Double click your Scene in the Project pane to make sure it is selected.
10. Click the PLAY Arrow at the top of the screen.
The text HELLO WORLD with a blue box should appear! Bloody hell we're done it!
Ok so how big is this basic file going to be if we deploy it to web? My first guess was several hundred K as I expected lots of unused assets and functionality of Unity to be included in the build. Let's find out....
11. MENU - File-> Build Settings - click add current which will put your "helloScene1" scene into the build list
12. Click BUILD and select a place to put the output files. Once done goto the files and open the WebPlayer folder and double click the WebPlayer.html file. Your new creation can be seen in the Browser!
The GOOD NEWS! The UNITY file is only 43K! HURRAH!
That will do for today :-) Tomorrow we can analyse what we have done and work out what GameObject, Scenes and Scripts are all about.
No comments:
Post a Comment