From 485e9e6f8e03169211f9bb92e6a561394007cbd3 Mon Sep 17 00:00:00 2001 From: shrmanator Date: Fri, 2 Jun 2023 14:56:43 -0400 Subject: [PATCH] Added more commenting --- VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs | 5 ++++- VRSBUTBI/Assets/TextPopupWindow.cs | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs b/VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs index ce15593a..e0a89032 100644 --- a/VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs +++ b/VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs @@ -185,9 +185,12 @@ private void OnGUI() playIcon)) { ScenePlayer.Player.PlayScene(); - } + } } + /// + /// Pauses the scene player if not already paused. + /// private void PauseScenePlayer() { if (!ScenePlayer.Player.isPaused){ScenePlayer.Player.PauseScene();} diff --git a/VRSBUTBI/Assets/TextPopupWindow.cs b/VRSBUTBI/Assets/TextPopupWindow.cs index 60fc13dc..f079d6a8 100644 --- a/VRSBUTBI/Assets/TextPopupWindow.cs +++ b/VRSBUTBI/Assets/TextPopupWindow.cs @@ -1,5 +1,8 @@ using UnityEngine; +/// +/// A class for displaying a pop-up window with instructions in a Unity application. +/// public class TextPopupWindow : MonoBehaviour { private bool showPopup = true; @@ -13,18 +16,24 @@ public class TextPopupWindow : MonoBehaviour // Create a GUIStyle to set the font size private GUIStyle guiStyle = new GUIStyle(); + /// + /// Initialize the pop-up window's properties at start. + /// private void Start() { // Set the font size - guiStyle.fontSize = 20; // adjust this value to change the font size + guiStyle.fontSize = 20; // Set the text color - guiStyle.normal.textColor = Color.white; // change this to the desired color + guiStyle.normal.textColor = Color.white; // Center the popup window popupRect = new Rect(Screen.width / 2 - 350, Screen.height / 2 - 125, 700, 250); } + /// + /// Displays the pop-up window if showPopup is set to true. + /// private void OnGUI() { if (showPopup) @@ -33,6 +42,11 @@ private void OnGUI() } } + /// + /// Defines the content and behaviour of the pop-up window. + /// Displays instruction text and a button that can close the window. + /// + /// The unique identifier for the window. private void ShowPopupWindow(int windowID) { // Add some text to the popup window