mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
23 lines
813 B
C#
23 lines
813 B
C#
|
using QSB.EchoesOfTheEye.EclipseCodeControllers.WorldObjects;
|
|||
|
using QSB.Messaging;
|
|||
|
|
|||
|
namespace QSB.EchoesOfTheEye.EclipseCodeControllers.Messages;
|
|||
|
|
|||
|
internal class MoveSelectorMessage : QSBWorldObjectMessage<QSBEclipseCodeController, (int newSelectedDial, bool up)>
|
|||
|
{
|
|||
|
public MoveSelectorMessage(int selectedDial, bool up) : base((selectedDial, up)) { }
|
|||
|
|
|||
|
public override void OnReceiveRemote()
|
|||
|
{
|
|||
|
WorldObject.AttachedObject._selectedDial = Data.newSelectedDial;
|
|||
|
if (WorldObject.AttachedObject.MoveSelectorToLocalPositionY(WorldObject.AttachedObject._dials[Data.newSelectedDial].transform.localPosition.y))
|
|||
|
{
|
|||
|
WorldObject.AttachedObject._gearInterfaceVertical.AddRotation(Data.up ? 45f : -45f, 0f);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
WorldObject.AttachedObject._gearInterfaceVertical.PlayFailure(Data.up, 0.5f);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|