split into multiple assemblies

This commit is contained in:
2022-11-20 12:52:22 +01:00
parent def03954a0
commit 9fdfafc3eb
373 changed files with 380 additions and 119 deletions

View File

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules;
using NaughtyAttributes;
using UnityEngine;
namespace EscapeRoomEngine.Desert.Runtime.Puzzle_A
{
[RequireComponent(typeof(Animator))]
public class Terminal : PuzzleState
{
private static readonly int LightFlash = Animator.StringToHash("Light Flash");
[BoxGroup("Internal")] [Required] public Emission light;
[BoxGroup("Internal")] public List<SymbolButton> symbols;
private Animator _animator;
private void Awake()
{
_animator = GetComponent<Animator>();
}
private void Start()
{
PuzzleEvent += (_, type) =>
{
switch (type)
{
case PuzzleEventType.Restarted:
light.color = theme.puzzleColor;
symbols.ForEach(symbol => symbol.Enable());
break;
case PuzzleEventType.Solved:
light.color = theme.solvedColor;
symbols.ForEach(symbol => symbol.Disable());
break;
case PuzzleEventType.WrongInput:
light.color = theme.puzzleColor;
_animator.SetTrigger(LightFlash);
break;
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}
};
TurnOnRingLight();
}
public void TurnOnRingLight()
{
light.active = true;
}
public void TurnOffRingLight()
{
light.active = false;
}
}
}