Posted by : JoGamerWorld sábado, 6 de abril de 2013

Aqui um script para menu principal, pode ser aplicado em qualquer GameObject do Unity 3D.

Here a script for main menu. Can be applied to any GameObject in Unity 3D.
O Script é auto explicativo copie ou baixe.
The script is self explanatory copy or download.




  1. //tamanho
  2. var TelaH: float;
  3. var TelaW: float;
  4. //posição
  5. var PosX : float;
  6. var Posy : float;
  7. //GUISkins
  8. var GuiSkin: GUISkin;
  9. var fundoMenu: GUISkin;
  10. function Start () {
  11. TelaH=Screen.height-Screen.height; // = 0
  12. TelaW=Screen.width-Screen.width; // = 0
  13. PosX=Screen.width-Screen.width; // = 0
  14. PosY=Screen.height-Screen.height; // = 0
  15.                                                                                                                 
  16. }
  17. function Update () {
  18. }
  19. function OnGUI () {
  20. //fundo do Menu
  21. GUI.skin=fundoMenu;
  22. GUI.Box (Rect (PosX,PosY,Screen.width,Screen.height), " ");
  23. //Botoes
  24. GUI.skin=GuiSkin; //V-nome do botão-V//
  25. if (GUI.Button (Rect (25, 25, 100, 30), "Iniciar")) {
  26. /* Botar o que vai acontecer quando o botão for clicado.
  27. No nosso caso vamos fazer ir a cena do jogo ou fazer sair do jogo*/
  28. Application.LoadLevel("..nome da cena.."); /* ou Application.Quit();*/
  29. }
  30. }

{ 1 comentários... read them below or add one }

Welcome to My Blog

Popular Post

Notícias/ News

I - Resident Evil: Revelations para 'PCs terá gráficos de nova geração'


II - Dell lança computador gamer Alienware X51 com Ubuntu
imagem

Tecnologia do Blogger.

- Copyright © All Making Games -AMG(c)- Powered by Blogger - Designed by Johanes Djogan -