- Home /
How do I make a menu and incorporate it into my game
I'm new to coding and I want to make a semi-nice menu for an iPhone racing game. Are there any programs to make menus that are compatible with Unity? If not is there a general template that i can fill in? I do know some code so i'm not completely in the dark.
Answer by samm565 · Aug 24, 2010 at 03:26 PM
Use Unity GUI, you can customize it too, im a beginner but it's really good. Here is some sample code, it's very simple. You don't have to give me credit.
- Create A New Javascript
- Put Sample Code (Code Is At Bottom) Into Your Javascript File
- Put Your Javascript File Onto Your Camera
- Have At Least 2 Scenes In Your Build Settings
- Have The Scene You Want To Load As Scene 1 Like This Screenshot
- Press Play
- If You Change "Application.LoadLevel (1);" to "Application.LoadLevel (2);" It Will Load Scene/Level 2
function OnGUI () { // Backround Box (Select Level) GUI.Box (Rect (10,10,100,50), "Select Level");
// Loads Scene 1 (in your build settings) if (GUI.Button (Rect (20,30,80,20), "Level 1")) { Application.LoadLevel (1); }
}
Your answer
Follow this Question
Related Questions
How to make Iphone Menu-Unity 2 Answers
Shader Incompatible with iPhone 0 Answers
Please help to create menu follow this Link 0 Answers
Pause menu in iPhone 2 Answers