/// <summary> /// If you want to add a button Response, first you must /// add a new Enum ID (open Enums.cs). /// Then add your case below and write the static function at the end of this script. /// </summary> /// <param name="ID"></param> public static void Response(buttonResponse ID) { switch (ID) { case buttonResponse.LOAD_MINIGAME_A: GoToMiniGameA(); break; case buttonResponse.LOAD_MINIGAME_B: GoToMiniGameB(); break; case buttonResponse.LOAD_MINIGAME_C: GoToMiniGameC(); break; case buttonResponse.LOAD_AWARDS_SCENE: GoToAwardsScene(); break; case buttonResponse.QUITAPP: QuitApp(); break; case buttonResponse.RETURN_TO_MAIN: ReturnToMain(); break; default: break; } }
public static void drawButton(string buttonText, buttonResponse buttonResponseFunction) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(buttonText)) { //F*****g ghetto but whatever, I wish I knew playing sounds would be such a pain in the ass without game objects CurrentGui.GuiAudioSource.PlayOneShot(CurrentGui.Click1); buttonResponseFunction(); } ; GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); }