finish puzzle a logic
This commit is contained in:
@@ -1,13 +1,39 @@
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules;
|
||||
using EscapeRoomEngine.Engine.Runtime;
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules;
|
||||
using NaughtyAttributes;
|
||||
|
||||
namespace EscapeRoomEngine.Desert.Runtime.Puzzle_A
|
||||
{
|
||||
public class Ball : ModuleState
|
||||
{
|
||||
[BoxGroup("Internal")] [Required] public Emission ringLight;
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user