Skip to content

Commit

Permalink
Added more commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
shrmanator committed Jun 2, 2023
1 parent c96eba0 commit 485e9e6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion VRSBUTBI/Assets/Scripts/GUI/InGameButtons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,12 @@ private void OnGUI()
playIcon))
{
ScenePlayer.Player.PlayScene();
}
}
}

/// <summary>
/// Pauses the scene player if not already paused.
/// </summary>
private void PauseScenePlayer()
{
if (!ScenePlayer.Player.isPaused){ScenePlayer.Player.PauseScene();}
Expand Down
18 changes: 16 additions & 2 deletions VRSBUTBI/Assets/TextPopupWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using UnityEngine;

/// <summary>
/// A class for displaying a pop-up window with instructions in a Unity application.
/// </summary>
public class TextPopupWindow : MonoBehaviour
{
private bool showPopup = true;
Expand All @@ -13,18 +16,24 @@ public class TextPopupWindow : MonoBehaviour
// Create a GUIStyle to set the font size
private GUIStyle guiStyle = new GUIStyle();

/// <summary>
/// Initialize the pop-up window's properties at start.
/// </summary>
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);
}

/// <summary>
/// Displays the pop-up window if showPopup is set to true.
/// </summary>
private void OnGUI()
{
if (showPopup)
Expand All @@ -33,6 +42,11 @@ private void OnGUI()
}
}

/// <summary>
/// Defines the content and behaviour of the pop-up window.
/// Displays instruction text and a button that can close the window.
/// </summary>
/// <param name="windowID">The unique identifier for the window.</param>
private void ShowPopupWindow(int windowID)
{
// Add some text to the popup window
Expand Down

0 comments on commit 485e9e6

Please sign in to comment.