mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
23 lines
538 B
C#
23 lines
538 B
C#
using QSB.EchoesOfTheEye.LightSensorSync.WorldObjects;
|
|
using QSB.Messaging;
|
|
|
|
namespace QSB.EchoesOfTheEye.LightSensorSync.Messages;
|
|
|
|
internal class SetIlluminatedMessage : QSBWorldObjectMessage<QSBLightSensor, bool>
|
|
{
|
|
public SetIlluminatedMessage(bool illuminated) : base(illuminated) { }
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
WorldObject.AttachedObject._illuminated = Data;
|
|
if (Data)
|
|
{
|
|
WorldObject.AttachedObject.OnDetectLight.Invoke();
|
|
}
|
|
else
|
|
{
|
|
WorldObject.AttachedObject.OnDetectDarkness.Invoke();
|
|
}
|
|
}
|
|
}
|