get theme colours from engine instead of storing reference to theme in module
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user