void Start() { //menuAnimator = menuContainer.GetComponent<Animator>(); source = gameObject.GetComponent <AudioSource>(); /* * gameObject.transform.position = * new Vector3( * gameObject.transform.position.x, * play_btn.transform.position.y, * gameObject.transform.position.z * ); */ SetSeletores(false, true); selecao = RETRYMENU.RETRY; }
void Update() { if (!freezeControls) { if (Input.GetAxis("Vertical") > 0) { if (selecao != RETRYMENU.MENU) { SetSeletores(true, false); selecao = RETRYMENU.MENU; source.PlayOneShot(menu_select, 1); } } else if (Input.GetAxis("Vertical") < 0) { if (selecao != RETRYMENU.RETRY) { SetSeletores(false, true); selecao = RETRYMENU.RETRY; source.PlayOneShot(menu_select, 1); } } else if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetAxis("Enter") > 0) { switch (selecao) { case RETRYMENU.MENU: LoadLevel(menuLevel); break; case RETRYMENU.RETRY: LoadLevel(gameLevel); break; } } } }