increase room diversity, improve ui
This commit is contained in:
34
Assets/Engine/Runtime/UI/PuzzlePlanEntry.cs
Normal file
34
Assets/Engine/Runtime/UI/PuzzlePlanEntry.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using EscapeRoomEngine.Engine.Runtime.Measurements;
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules.Description;
|
||||
using EscapeRoomEngine.Engine.Runtime.Utilities;
|
||||
using NaughtyAttributes;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace EscapeRoomEngine.Engine.Runtime.UI.Elements
|
||||
{
|
||||
/// <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]
|
||||
private Text puzzleName, estimatedTime;
|
||||
|
||||
public Vector2 Position
|
||||
{
|
||||
set
|
||||
{
|
||||
puzzleName.rectTransform.anchoredPosition = value;
|
||||
}
|
||||
}
|
||||
public PuzzleModuleDescription Puzzle
|
||||
{
|
||||
set
|
||||
{
|
||||
puzzleName.text = value.puzzleName;
|
||||
estimatedTime.text = $"Est. {Measure.EstimateTime(value).ToTimeSpan():mm':'ss}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user