Quantum 3
3.0.9
A simple menu to utilize the most common Photon connection and game start modes. More...
Classes | |
| class | UIBindings |
| Includes all ui element bindings for the menu. More... | |
Public Member Functions | |
| virtual void | SetPanelVisibility (bool isShowing, float normalizedAnimationTime=0.0f) |
| Set the visibility of the panel and play show and hide animations. More... | |
| virtual async System.Threading.Tasks.Task | TryExecuteMppmCommand (QuantumMppmCommand command) |
| Multiplayer Play Mode command execution. Allows to start Mppm instances of the menu simultaneously and connect to the same room. More... | |
Public Attributes | |
| bool | DisableAfterLoadingFromDifferentScene |
| Disable the menu when this scene is loaded from a different scene (e.g. another online menu). More... | |
| bool | ForceRunInBackground = true |
| Force enabled Application.runInBackground to improve the online stability in background mode. Works on all platforms, but mobile and WebGL games should consider what behavior is best. More... | |
| int | PingDelta = 81 |
| The ping threshold between signal strength icons. More... | |
| bool | ReloadSceneAfterShutdown = true |
| Reload this scene after shutting down the game. More... | |
| bool | ToggleUnityCursor |
| Toggle UnityEngine.Cursor on and off when enabled and disabling the menu. More... | |
Protected Types | |
| enum | State |
| Simple menu state machine to prevent multiple start and shutdown calls. More... | |
| enum | Tab |
| Available tabs are hard-coded. More... | |
Protected Member Functions | |
| virtual void | Awake () |
| Unity Awake() method to register button listeners and get components. More... | |
| virtual async void | OnConnectionError (string errorMessage) |
| A callback from the connection logic to report errors during runtime. More... | |
| virtual void | OnCopyRoomNamePressed () |
| Copy the room name button was pressed. PhotonStartUICopyToClipboard has a different implementation in WebGL. More... | |
| virtual async void | OnDisconnectPressed () |
| The user pressed the disconnect button, shutdown the game and disconnect from the server. More... | |
| virtual void | OnEnable () |
| Unity OnEnable() method to initialize the menu UI elements and set the initial state. More... | |
| virtual void | OnMuteValueChanged (bool value) |
| The sound mute button toggle was pressed. More... | |
| virtual async void | OnPlayPressed () |
| Start the game when the user pressed the play button. More... | |
| virtual void | OnPopupPressed () |
| The user pressed the popup button, complete the task so ShowPopupAsync(string) can complete. More... | |
| virtual void | OnQuitPressed () |
| Quit the application when the user pressed the quit button. More... | |
| virtual void | OnTabSelected (Tab tab) |
| Change visibility of elements based on the selected tab. More... | |
| virtual void | OnTogglePressed () |
| Toggle menu button pressed will show or hide the main menu panel. More... | |
| virtual async System.Threading.Tasks.Task | ShowPopupAsync (string message) |
| Show the popup screen and wait for the user to close it. If a popup is already shown, it will wait for that one instead and not show the second one. More... | |
| virtual async System.Threading.Tasks.Task | ShutdownGameAsync () |
| Shutdown the game and disconnect from the server. Will ignore subsequent calls until the shutdown is complete. More... | |
| virtual async System.Threading.Tasks.Task | StartGameAsync (bool isOnline, string playerName, string roomName, string region) |
| Handling commencing the connection and game start. Mostly UI boilerplate, enabling and disabling UI elements, setting status text, etc. Calls QuantumStartUIConnectionBase.ConnectAsync(QuantumStartUIConnectionBase.StartParameter) to start the connection and game. More... | |
| virtual void | Update () |
| Unity Update() method updates a few things by polling. More... | |
Static Protected Member Functions | |
| static void | PhotonStartUICopyToClipboard (string text) |
| Copy the given text to the system clipboard. Has a different implementation in WebGL builds, where it uses a JavaScript function to copy to clipboard. More... | |
Protected Attributes | |
| Animator | Animator |
| The animator controller component. The menu also works without an animator. More... | |
| QuantumStartUIConnectionBase | Connection |
| The connection implementation that handles the connection to the Photon server and game start. Will be tried to retrieved during Awake. More... | |
| State | CurrentState |
| Is set during the async shutdown process to prevent multiple shutdown calls. More... | |
| Tab | CurrentTab |
| The currently selected tab. More... | |
| List< UnityEngine.UI.Selectable > | ToggleInputGroup |
| A list of UI elements that are set non-interactable during starting process, populated internally. More... | |
| UIBindings | UI |
| The UI bindings for the menu. More... | |
Static Protected Attributes | |
| static readonly int | AnimationHashHide = Animator.StringToHash("Hide") |
| Cached Hide animation hash. More... | |
| static readonly int | AnimationHashShow = Animator.StringToHash("Show") |
| Cached Show animation hash. More... | |
Properties | |
| bool? | IsMuted [get, set] |
| Load and save the muted state in Player Prefs. More... | |
| string | PlayerName [get, set] |
| Load and save the name player name in Payer Prefs. More... | |
| string | Region [get, set] |
| Load and save the selected region in Player Prefs. More... | |
A simple menu to utilize the most common Photon connection and game start modes.
|
strongprotected |
|
strongprotected |
Available tabs are hard-coded.
|
staticprotected |
Copy the given text to the system clipboard. Has a different implementation in WebGL builds, where it uses a JavaScript function to copy to clipboard.
| text |
|
inlinevirtual |
Multiplayer Play Mode command execution. Allows to start Mppm instances of the menu simultaneously and connect to the same room.
| command | Mppm command |
|
inlinevirtual |
Set the visibility of the panel and play show and hide animations.
| isShowing | Menu main panel visibility |
| normalizedAnimationTime | The time offset between zero and one forwarded to the show animation. |
|
inlineprotectedvirtual |
Unity Awake() method to register button listeners and get components.
|
inlineprotectedvirtual |
Unity OnEnable() method to initialize the menu UI elements and set the initial state.
|
inlineprotectedvirtual |
Unity Update() method updates a few things by polling.
|
inlineprotectedvirtual |
Handling commencing the connection and game start. Mostly UI boilerplate, enabling and disabling UI elements, setting status text, etc. Calls QuantumStartUIConnectionBase.ConnectAsync(QuantumStartUIConnectionBase.StartParameter) to start the connection and game.
| isOnline | Non-online start does not require a connection. |
| playerName | Player name to use for the connection. |
| roomName | Room name, can be null. |
| region | Region to use. |
|
inlineprotectedvirtual |
Shutdown the game and disconnect from the server. Will ignore subsequent calls until the shutdown is complete.
|
inlineprotectedvirtual |
Show the popup screen and wait for the user to close it. If a popup is already shown, it will wait for that one instead and not show the second one.
| message | Message to display in the popup |
|
inlineprotectedvirtual |
A callback from the connection logic to report errors during runtime.
| errorMessage | The error message to display to the user |
|
inlineprotectedvirtual |
Copy the room name button was pressed. PhotonStartUICopyToClipboard has a different implementation in WebGL.
|
inlineprotectedvirtual |
The user pressed the disconnect button, shutdown the game and disconnect from the server.
|
inlineprotectedvirtual |
The sound mute button toggle was pressed.
| value | Muted state. |
|
inlineprotectedvirtual |
Start the game when the user pressed the play button.
|
inlineprotectedvirtual |
The user pressed the popup button, complete the task so ShowPopupAsync(string) can complete.
|
inlineprotectedvirtual |
Quit the application when the user pressed the quit button.
|
inlineprotectedvirtual |
Toggle menu button pressed will show or hide the main menu panel.
|
inlineprotectedvirtual |
Change visibility of elements based on the selected tab.
| tab | Selected tab. |
|
staticprotected |
Cached Hide animation hash.
|
staticprotected |
Cached Show animation hash.
| bool Quantum.QuantumStartUI.ToggleUnityCursor |
Toggle UnityEngine.Cursor on and off when enabled and disabling the menu.
| bool Quantum.QuantumStartUI.ForceRunInBackground = true |
Force enabled Application.runInBackground to improve the online stability in background mode. Works on all platforms, but mobile and WebGL games should consider what behavior is best.
| bool Quantum.QuantumStartUI.ReloadSceneAfterShutdown = true |
Reload this scene after shutting down the game.
| bool Quantum.QuantumStartUI.DisableAfterLoadingFromDifferentScene |
Disable the menu when this scene is loaded from a different scene (e.g. another online menu).
| int Quantum.QuantumStartUI.PingDelta = 81 |
The ping threshold between signal strength icons.
|
protected |
The UI bindings for the menu.
|
protected |
A list of UI elements that are set non-interactable during starting process, populated internally.
|
protected |
The connection implementation that handles the connection to the Photon server and game start. Will be tried to retrieved during Awake.
|
protected |
The animator controller component. The menu also works without an animator.
|
protected |
Is set during the async shutdown process to prevent multiple shutdown calls.
|
protected |
The currently selected tab.
|
getsetprotected |
Load and save the name player name in Payer Prefs.
|
getsetprotected |
Load and save the selected region in Player Prefs.
|
getsetprotected |
Load and save the muted state in Player Prefs.