laser emitter module
This commit is contained in:
18
Assets/Station46/Modules/Laser/Scripts/LaserButtonEmitter.cs
Normal file
18
Assets/Station46/Modules/Laser/Scripts/LaserButtonEmitter.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using NaughtyAttributes;
|
||||
using Station46.Scripts;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Station46.Modules.Laser.Scripts
|
||||
{
|
||||
public class LaserButtonEmitter : LaserEmitter
|
||||
{
|
||||
[BoxGroup("Internal")] [SerializeField] private Button button;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
button.ButtonEvent += (_, type) => laser.firing = type == ButtonEventType.Pressed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b54c89b5d984a33b015bfcd8a793d8c
|
||||
timeCreated: 1683675862
|
||||
@@ -1,6 +1,19 @@
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules;
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules.State;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Station46.Modules.Laser.Scripts
|
||||
{
|
||||
public class LaserEmitter : Laser
|
||||
[RequireComponent(typeof(Laser))]
|
||||
public class LaserEmitter : ModuleState
|
||||
{
|
||||
protected Laser laser;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
laser = GetComponent<Laser>();
|
||||
}
|
||||
|
||||
public override void SetModule(Module module) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user