- Home /
Main Menu 3d text
hi I'm from chile and I'm making a menu with 3d text and programmed in C #, my question is that when clicking "jugar" I want the camera to pan 180 degrees to point toward another wall where haigan other options or be dragged into another wall to see other options. N addition to this I would like to know how to name the player, and I use a multiplayer function. Here is the code for that can help me.
thanks
using UnityEngine; using System.Collections; public class Main : MonoBehaviour { public int number = 0; private GameObject Jugar, Multijugador, Salir; private void Start() { Jugar = GameObject.Find("/casa/madera larga menu/Jugar"); Multijugador = GameObject.Find("/casa/madera larga menu/Multijugador"); Salir = GameObject.Find("/casa/madera larga menu/Salir"); } private void Update() { switch(number) { case 0: Jugar.renderer.material.color = Color.red; Multijugador.renderer.material.color = Color.red; Salir.renderer.material.color = Color.red; break; case 1: Jugar.renderer.material.color = Color.white; Multijugador.renderer.material.color = Color.red; Salir.renderer.material.color = Color.red; break; case 2: Jugar.renderer.material.color = Color.red; Multijugador.renderer.material.color = Color.white; Salir.renderer.material.color = Color.red; break; case 3: Jugar.renderer.material.color = Color.red; Multijugador.renderer.material.color = Color.red; Salir.renderer.material.color = Color.white; break; } if (Input.GetButtonDown("Fire1") && number != 0) { switch (number) { case 1: //Jugar clickeado break; case 2: //Multijugador clickeado break; case 3: Application.Quit (); break; } } } }
you could just do camera.main.transform.rotation to control where you want to rotate the camera. This controls the '$$anonymous$$ain Camera' object which is the only object when creating a new scene. If you would like to accept some sort of input for text you would still use the Input method, but now when you receive input Unity stores the letters as values, which you just need to then convert these values to some standard form text which you probably just want UTF-8, which is standard.
This should help get you started http://docs.unity3d.com/Documentation/ScriptReference/Input-inputString.html
I could show the code after
case 1: / / Jugar clicked
please to move in 180°