get theme colours from engine instead of storing reference to theme in module

This commit is contained in:
2022-11-28 22:14:00 +01:00
parent 8398d29f25
commit 60e390a993
32 changed files with 151 additions and 14 deletions

View File

@@ -1,15 +1,22 @@
using EscapeRoomEngine.Engine.Runtime;
using EscapeRoomEngine.Engine.Runtime.Modules;
using EscapeRoomEngine.Engine.Runtime.Modules;
using NaughtyAttributes;
using UnityEngine;
namespace EscapeRoomEngine.Desert.Runtime.Puzzle_A
{
public class Ball : ModuleState
{
public EngineTheme theme;
[BoxGroup("Internal")] [Required] public Emission statusLight;
[BoxGroup("Internal")] [Required] public Ring ring;
private Color _puzzleColor, _solvedColor;
private void Awake()
{
_puzzleColor = Engine.Runtime.Engine.DefaultEngine.theme.puzzleColor;
_solvedColor = Engine.Runtime.Engine.DefaultEngine.theme.solvedColor;
}
public bool StatusLight
{
set => statusLight.active = value;
@@ -22,7 +29,7 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_A
{
_active = value;
statusLight.color = _active ? theme.puzzleColor : theme.solvedColor;
statusLight.color = _active ? _puzzleColor : _solvedColor;
ring.rotating = _active;
if (!_active)
{