mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
add spin message
This commit is contained in:
parent
c4568946ee
commit
04eeb702ae
@ -111,7 +111,7 @@ public class QSBGuardAction : QSBGhostAction
|
||||
}
|
||||
else
|
||||
{
|
||||
_controller.AttachedObject.Spin(TurnSpeed.MEDIUM);
|
||||
_controller.Spin(TurnSpeed.MEDIUM);
|
||||
}
|
||||
|
||||
_searchingAtNode = true;
|
||||
|
@ -63,7 +63,7 @@ public class QSBSearchAction : QSBGhostAction
|
||||
|
||||
public override void OnArriveAtPosition()
|
||||
{
|
||||
_controller.AttachedObject.Spin(TurnSpeed.MEDIUM);
|
||||
_controller.Spin(TurnSpeed.MEDIUM);
|
||||
_searchingAtNode = true;
|
||||
_searchStartTime = Time.time;
|
||||
}
|
||||
|
15
QSB/EchoesOfTheEye/Ghosts/Messages/SpinMessage.cs
Normal file
15
QSB/EchoesOfTheEye/Ghosts/Messages/SpinMessage.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using GhostEnums;
|
||||
using QSB.EchoesOfTheEye.Ghosts.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.Ghosts.Messages;
|
||||
|
||||
internal class SpinMessage : QSBWorldObjectMessage<QSBGhostController, TurnSpeed>
|
||||
{
|
||||
public SpinMessage(TurnSpeed turnSpeed) : base(turnSpeed) { }
|
||||
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
WorldObject.Spin(Data, true);
|
||||
}
|
||||
}
|
@ -277,4 +277,20 @@ public class QSBGhostController : WorldObject<GhostController>, IGhostObject
|
||||
|
||||
AttachedObject.StopFacing();
|
||||
}
|
||||
|
||||
public void Spin(TurnSpeed turnSpeed, bool remote = false)
|
||||
{
|
||||
if (!remote)
|
||||
{
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.SendMessage(new SpinMessage(turnSpeed));
|
||||
}
|
||||
|
||||
// SPEEEEEEEEEN
|
||||
AttachedObject.Spin(turnSpeed);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user