void OnGUI() { for (int i = 0; i < MenuNumber; i++) { if (i >= btn_name.Length) { name_index = i % btn_name.Length; } else { name_index = i; } if (GUI.Button(new Rect(btn_start_pos + i * btn_width, dynamic_height, btn_width, btn_height), btn_name [name_index])) { if (i == 0) { DisplayMode_Script.DisplayModeChange(); btn_name[0] = DisplayMode_Script.display_str; // if (skin_on) { // btn_name [0] = show_skin; // skin_on = false; // DisplayMode_Script.Hide (); // } else { // btn_name [0] = hide_skin; // skin_on = true; // DisplayMode_Script.Display (); // } } if (i == 1) { Camera_Script.display_menu = true; } if (i == 2) { PathLineDraw_Script.display_menu = true; } if (i == 3) { ToolChange_Script.display_menu = true; } if (i == 4) { AutoMove_Script.display_menu = true; } if (i == 6) { Reset_Script.display_menu = true; } if (i == 7) { PlayerPrefs.SetInt("RunningTimeH", Main.RunningTimeH); PlayerPrefs.SetInt("RunningTimeM", Main.RunningTimeM); PlayerPrefs.SetInt("PartsNum", Main.PartsNum); Application.Quit(); } // Debug.Log(btn_name[name_index]); if (RightclickMenu_Script.rightclick_menu_on) { RightclickMenu_Script.rightclick_menu_on = false; } } } Event e = Event.current; if (menu_rent.Contains(e.mousePosition)) { menu_hide = false; } else { menu_hide = true; } }