quantum-space-buddies/QSB/MeteorSync/Messages/MeteorLaunchMessage.cs
JohnCorby a3ab23395f Revert "better meteor patches"
This reverts commit 7c57b1b69d.
2022-02-14 15:25:43 -08:00

35 lines
823 B
C#

using Mirror;
using QSB.Messaging;
using QSB.MeteorSync.WorldObjects;
namespace QSB.MeteorSync.Messages
{
public class MeteorLaunchMessage : QSBWorldObjectMessage<QSBMeteorLauncher>
{
private int MeteorId;
private float LaunchSpeed;
public MeteorLaunchMessage(QSBMeteorLauncher qsbMeteorLauncher)
{
MeteorId = qsbMeteorLauncher.MeteorId;
LaunchSpeed = qsbMeteorLauncher.LaunchSpeed;
}
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write(MeteorId);
writer.Write(LaunchSpeed);
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
MeteorId = reader.Read<int>();
LaunchSpeed = reader.Read<float>();
}
public override void OnReceiveRemote() => WorldObject.LaunchMeteor(MeteorId, LaunchSpeed);
}
}