comment pass

This commit is contained in:
2022-12-29 16:16:49 +01:00
parent 643e03192a
commit ff01a700bd
75 changed files with 634 additions and 65 deletions

View File

@@ -13,12 +13,22 @@ namespace EscapeRoomEngine.Engine.Runtime.UI
Stopped, Paused, Running
}
/// <summary>
/// The component that manages the gamemaster UI and the time.
/// </summary>
public class GameControl : MonoBehaviour
{
/// <summary>
/// The active instance of the game control.
/// </summary>
public static GameControl Instance { get; private set; }
[Tooltip("How much time in seconds should be between UI updates.")]
[SerializeField]
private float uiUpdateInterval = 1, planUpdateInterval = 1;
private float uiUpdateInterval = 1;
[Tooltip("How much time in seconds should be between puzzle plan updates.")]
[SerializeField]
private float planUpdateInterval = 1;
[BoxGroup("Internal")] [SerializeField]
private Button startButton, stopButton, pauseButton, addTimeButton, removeTimeButton;
[BoxGroup("Internal")] [SerializeField]
@@ -36,10 +46,25 @@ namespace EscapeRoomEngine.Engine.Runtime.UI
set => puzzlePlan.Puzzles = value;
}
/// <summary>
/// The time that elapsed since the game was started.
/// </summary>
public float TimeElapsed { get; private set; }
/// <summary>
/// The time the player has spent in this room.
/// </summary>
public float TimeInRoom { get; set; }
/// <summary>
/// The target time set by the game master.
/// </summary>
public float TargetTime { get; private set; }
/// <summary>
/// The estimated total time the player will have spent when they finish this room.
/// </summary>
public float EstimatedTimeRoom { get; private set; }
/// <summary>
/// The estimated total time the player will spend in the experience.
/// </summary>
public float EstimatedTime { get; private set; }
private float _previousUIUpdate, _previousPlanUpdate;

View File

@@ -4,6 +4,9 @@ using UnityEngine.UI;
namespace EscapeRoomEngine.Engine.Runtime.UI
{
/// <summary>
/// This component is responsible to change the icon of the pause button depending on the game state.
/// </summary>
public class PauseButton : MonoBehaviour
{
[BoxGroup("Internal")] [SerializeField]

View File

@@ -2,12 +2,17 @@ using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules;
using NaughtyAttributes;
using UnityEngine;
using UnityEngine.UI;
namespace EscapeRoomEngine.Engine.Runtime.UI
{
/// <summary>
/// The puzzle plan UI component that displays the current puzzle plan in the game master window.
/// </summary>
public class PuzzlePlan : MonoBehaviour
{
/// <summary>
/// The distance from one entry to the next.
/// </summary>
[SerializeField]
private Vector2 entryOffset;
[BoxGroup("Internal")] [SerializeField]

View File

@@ -1,4 +1,3 @@
using System;
using EscapeRoomEngine.Engine.Runtime.Measurements;
using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Utilities;
@@ -8,6 +7,9 @@ using UnityEngine.UI;
namespace EscapeRoomEngine.Engine.Runtime.UI
{
/// <summary>
/// An entry in the <see cref="PuzzlePlan"/> UI component that displays the name and estimated time for a puzzle.
/// </summary>
public class PuzzlePlanEntry : MonoBehaviour
{
[BoxGroup("Internal")] [Required] [SerializeField]