void highlightNextButton() { if (!this.isSubMenuOpen) { Buttons nextButton; if (this.currentSelection == Buttons.Exit) { nextButton = Buttons.Basic; } else { nextButton = this.currentSelection + 1; } this.currentSelection = nextButton; this.HighlightButton(this.buttons [(int)nextButton]); } else { CourseButtons nextButton; if (this.subSelection == CourseButtons.Back) { nextButton = CourseButtons.Start; } else { nextButton = this.subSelection + 1; } this.subSelection = nextButton; this.HighlightButton(this.courseButtons [(int)nextButton]); } }
// Use this for initialization void Start() { if (OVRManager.display.isPresent) { // Disable normal camera if Rift is connected this.oculusCam.gameObject.SetActive(true); this.mainCam.gameObject.SetActive(false); } else { this.mainCam.gameObject.SetActive(true); this.oculusCam.gameObject.SetActive(false); } this.menu = GameObject.Find("Menu"); this.courseMenu = GameObject.Find("CourseMenu"); this.loadingScreen = GameObject.Find("LoadingScreen"); Invoke("CloseLoadingScreen", 3); //TODO: Change to current course this.currentSelection = Buttons.Basic; this.subSelection = CourseButtons.Start; HideMenu(); this.buttons = new GameObject[8]; this.buttons [0] = GameObject.Find("BasicButton"); this.buttons [1] = GameObject.Find("ParkingButton"); this.buttons [2] = GameObject.Find("InterstateButton"); this.buttons [3] = GameObject.Find("WeatherButton"); this.buttons [4] = GameObject.Find("HazardButton"); this.buttons [5] = GameObject.Find("JoyrideButton"); this.buttons [6] = GameObject.Find("ControlsButton"); this.buttons [7] = GameObject.Find("ExitButton"); this.courseButtons = new GameObject[7]; this.courseButtons [0] = GameObject.Find("StartButton"); this.courseButtons [1] = GameObject.Find("BackButton"); }
void Select() { if (!this.isSubMenuOpen) { if (this.currentSelection == Buttons.Basic) { this.menu.GetComponent <Canvas>().enabled = false; this.courseMenu.GetComponent <Canvas>().enabled = true; this.UnhighlightButton(); this.HighlightButton(this.courseButtons[0]); this.subSelection = CourseButtons.Start; this.isSubMenuOpen = true; } else if (this.currentSelection == Buttons.Exit) { Application.Quit(); } } else { if (this.subSelection == CourseButtons.Back) { this.Back(); } else if (this.subSelection == CourseButtons.Start) { if (this.currentSelection == Buttons.Basic) { this.HideMenu(); this.courseMenu.GetComponent <Canvas>().enabled = false; this.loadingScreen.GetComponent <Canvas>().enabled = true; Application.LoadLevel("Clutch"); } } } //TODO Play sound }
void highlightPreviousButton() { if (!this.isSubMenuOpen) { Buttons previousButton; if (this.currentSelection == Buttons.Basic) { previousButton = Buttons.Exit; } else { previousButton = this.currentSelection - 1; } this.currentSelection = previousButton; this.HighlightButton(this.buttons [(int)previousButton]); } else { CourseButtons previousButton; if (this.subSelection == CourseButtons.Start) { previousButton = CourseButtons.Back; } else { previousButton = this.subSelection - 1; } this.subSelection = previousButton; this.HighlightButton(this.courseButtons [(int)previousButton]); } //TODO: Play sound }