39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using EscapeRoomEngine.Engine.Runtime;
|
|
using EscapeRoomEngine.Engine.Runtime.Modules;
|
|
using NaughtyAttributes;
|
|
|
|
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;
|
|
|
|
public bool StatusLight
|
|
{
|
|
set => statusLight.active = value;
|
|
}
|
|
|
|
public bool Active
|
|
{
|
|
get => _active;
|
|
set
|
|
{
|
|
_active = value;
|
|
|
|
statusLight.color = _active ? theme.puzzleColor : theme.solvedColor;
|
|
ring.rotating = _active;
|
|
if (!_active)
|
|
{
|
|
ring.crystal.Active = false;
|
|
ring.symbols.ForEach(symbol => symbol.Active = false);
|
|
}
|
|
}
|
|
}
|
|
|
|
private bool _active;
|
|
|
|
public override void SetModule(Module module) {}
|
|
}
|
|
} |