beacons
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using EscapeRoomEngine.Engine.Runtime.Modules.State;
|
||||
using JetBrains.Annotations;
|
||||
using NaughtyAttributes;
|
||||
using Station46.Scripts;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -10,6 +12,9 @@ namespace Station46.Modules.Portal.Scripts
|
||||
[RequireComponent(typeof(Emission))]
|
||||
public class Station46Portal : EscapeRoomEngine.Portal.Runtime.Portal
|
||||
{
|
||||
[BoxGroup("Internal")] [SerializeField] [CanBeNull] private LineRenderer beacon;
|
||||
[BoxGroup("Internal")] [SerializeField] [CanBeNull] private AudioSource beaconAudio;
|
||||
|
||||
private Emission _emission;
|
||||
|
||||
protected override void Awake()
|
||||
@@ -25,9 +30,25 @@ namespace Station46.Modules.Portal.Scripts
|
||||
{
|
||||
case DoorEventType.Unlocked:
|
||||
_emission.color = EscapeRoomEngine.Engine.Runtime.Engine.Theme.solvedColor.hdr;
|
||||
if (beacon != null)
|
||||
{
|
||||
beacon.enabled = true;
|
||||
}
|
||||
if (beaconAudio != null)
|
||||
{
|
||||
beaconAudio.Play();
|
||||
}
|
||||
break;
|
||||
case DoorEventType.Locked:
|
||||
_emission.color = EscapeRoomEngine.Engine.Runtime.Engine.Theme.puzzleColor.hdr;
|
||||
if (beacon != null)
|
||||
{
|
||||
beacon.enabled = false;
|
||||
}
|
||||
if (beaconAudio != null)
|
||||
{
|
||||
beaconAudio.Stop();
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user