mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
Revert "Revert "LightSensorIlluminatedMessage""
This reverts commit 283bf05887
.
This commit is contained in:
parent
0a88acd64c
commit
d64ab99d8c
@ -0,0 +1,27 @@
|
||||
using QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
||||
|
||||
internal class LightSensorIlluminatedMessage : QSBWorldObjectMessage<QSBLightSensor, bool>
|
||||
{
|
||||
public LightSensorIlluminatedMessage(bool illuminated) : base(illuminated) { }
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
if (WorldObject.AttachedObject._illuminated == Data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WorldObject.AttachedObject._illuminated = Data;
|
||||
if (Data)
|
||||
{
|
||||
WorldObject.AttachedObject.OnDetectLight.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldObject.AttachedObject.OnDetectDarkness.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user