get theme colours from engine instead of storing reference to theme in module
This commit is contained in:
27
Assets/Desert/Runtime/Puzzle B/PuzzleB.cs
Normal file
27
Assets/Desert/Runtime/Puzzle B/PuzzleB.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules;
|
||||
using JetBrains.Annotations;
|
||||
using NaughtyAttributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace EscapeRoomEngine.Desert.Runtime.Puzzle_B
|
||||
{
|
||||
public class PuzzleB : StatePuzzle
|
||||
{
|
||||
[ValidateInput("CorrectRotatorCount")]
|
||||
public List<Transform> rotators;
|
||||
|
||||
protected override void StatesUpdate()
|
||||
{
|
||||
base.StatesUpdate();
|
||||
|
||||
for (var i = 0; i < stateCount; i++)
|
||||
{
|
||||
rotators[i].localRotation = Quaternion.AngleAxis(states[i], Vector3.up);
|
||||
}
|
||||
}
|
||||
|
||||
[UsedImplicitly]
|
||||
private bool CorrectRotatorCount(List<Transform> list) => list != null && list.Count == stateCount;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user