comment pass
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user