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

@@ -16,8 +16,12 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_B
public List<int> stateIndices;
}
/// <summary>
/// The main component for the hexagon module.
/// </summary>
public class PuzzleB : StatePuzzle
{
[Tooltip("How many seconds the buttons should be disabled until another input is accepted.")]
[SerializeField] [Min(0)]
private float buttonCooldown;
[ValidateInput("CorrectRotatorCount")]
@@ -86,6 +90,9 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_B
}
}
/// <summary>
/// Switch all rotators specified by a given action.
/// </summary>
private void Switch(ButtonAction action)
{
for (var i = 0; i < action.stateIndices.Count; i++)
@@ -99,7 +106,7 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_B
}
}
[UsedImplicitly]
[UsedImplicitly] // used for field validation
private bool CorrectRotatorCount(List<Rotator> list) => list != null && list.Count == stateCount;
}
}

View File

@@ -3,11 +3,18 @@ using UnityEngine;
namespace EscapeRoomEngine.Desert.Runtime.Puzzle_B
{
/// <summary>
/// The rotator component used by the hexagon module.
/// </summary>
[RequireComponent(typeof(Emission))]
public class Rotator : MonoBehaviour
{
[Range(0, 359)] public int angle;
[Range(0, 1)] public float speed;
[Tooltip("The angle this rotator should rotate towards.")]
[Range(0, 359)]
public int angle;
[Tooltip("How quickly to rotate towards the target angle.")]
[Range(0, 1)]
public float speed;
public Emission Emission { get; private set; }