void select() { resetMouse(); setSelected(counter); menuScript = selected.GetComponent <WelcomeMenuEffects>(); menuScript.setRowNumber(1); selected.GetComponent <OTSprite>().size = size + new Vector2(100, 100); audio.PlayOneShot(selectSound); }
void resetMouse() { if (mouse) { for (int i = 0; i < 3; i++) { setSelected(i); menuScript = selected.GetComponent <WelcomeMenuEffects>(); menuScript.setRowNumber(0); selected.GetComponent <OTSprite>().size = size; } mouse = false; } }
// Update is called once per frame void Update() { if (Input.GetKeyDown("down")) { if (!isFirst) { menuScript.setRowNumber(0); selected.GetComponent <OTSprite>().size = size; if (counter != 3) { counter++; } else { counter = 0; } } else { isFirst = false; } select(); } if (Input.GetKeyDown("up")) { if (!isFirst) { menuScript.setRowNumber(0); selected.GetComponent <OTSprite>().size = size; if (counter != 0) { counter--; } else { counter = 3; } } else { isFirst = false; } select(); } if (Input.GetKeyDown(KeyCode.Return)) { if (!isFirst) { switch (counter) { case 0: Application.LoadLevel("game"); break; case 1: //Application.LoadLevel("highsocres"); break; case 2: Application.LoadLevel("Options Menu"); break; case 3: Application.Quit(); break; default: break; } } } }