mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-18 13:23:05 +00:00
a3ab23395f
This reverts commit 7c57b1b69d
.
35 lines
823 B
C#
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);
|
|
}
|
|
}
|