Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by wadawalnut · Aug 05, 2012 at 04:51 PM · fpsgamehow tomain menu

Main Menu Instructions?

Hello, I have made a main menu for my game and it only has two options, start game or quit game. I would like to have a "How to Play" option, but for that would I need to make a scene with just one huge 3d text? Is there a way it can open a word document or something? Thanks a lot!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by aldonaletto · Aug 05, 2012 at 05:41 PM

You could have several different menus in the same scene using the GUI system - like this:

enum MenuID {MainMenu, HowToPlay} // menu types

var curMenu: MenuID = MenuID.MainMenu; // start at the main menu var playInstructions: String = "AD moves left/right\nWS moves forth/back";

function OnGUI(){ switch (curMenu){ case MenuID.MainMenu: // if main menu... // draw the main menu buttons: if (GUI.Button(Rect(...), "Start Game")){ // start the game } break; if (GUI.Button(Rect(...), "Quit")){ // quit the game } if (GUI.Button(Rect(...), "How To Play")){ curMenu = MenuID.HowToPlay; // select the "How To Play" menu } break; case MenuID.HowToPlay: // if how to play selected... // display the instructions: GUI.Label(Rect(...), playInstructions)); if (GUI.Button(Rect(...), "Main Menu")){ curMenu = MenuID.MainMenu; } break; } } You can use textures instead of strings with GUI.Label, producing much better results than plain text.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wadawalnut · Aug 05, 2012 at 07:47 PM 0
Share

Thanks a lot everyone! I'll try them both out and see which one I like best!

avatar image
0
Wiki

Answer by RodrigoSeVeN · Aug 05, 2012 at 07:24 PM

In case you choose to open an external file, you may try the code found in this question here: http://answers.unity3d.com/questions/16675/running-an-external-exe-file-from-unity.html

Still, to simplify things, consider that you put your text file inside the Assets folder and test this code to see if it meets your objective. This is in javascript by the way.

 import System.Diagnostics;
 function Start(){
  var stringPath = Application.dataPath+"/HowToPlayDoc.txt";
  var myProcess = new Process();
  myProcess.StartInfo.FileName = "Notepad.exe";
  myProcess.StartInfo.Arguments = stringPath;
  myProcess.Start();
 }

As you can see, it is calling the Notepad.exe and a .txt file. This should consider the platform the build was made for. There are more advanced methods to load data like this, but this is very simple, so check your needs and/or dig further into this solution if you find it necessary.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Horror Game AI script recommendation? 1 Answer

FPS Game Level Loader 0 Answers

FPS KIT VERSION 2.0 0 Answers

A node in a childnode? 1 Answer

How to make an ingame weapon/ammo shop 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges