mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
AirlockVariableSyncer: sync a couple other things ¯\_(ツ)_/¯
This commit is contained in:
parent
5aea577e40
commit
0a9ccfd0db
@ -1,4 +1,5 @@
|
||||
using QSB.EchoesOfTheEye.AirlockSync.WorldObjects;
|
||||
using Mirror;
|
||||
using QSB.EchoesOfTheEye.AirlockSync.WorldObjects;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.AirlockSync.VariableSync;
|
||||
@ -6,4 +7,24 @@ namespace QSB.EchoesOfTheEye.AirlockSync.VariableSync;
|
||||
internal class AirlockVariableSyncer : RotatingElementsVariableSyncer<QSBGhostAirlock>
|
||||
{
|
||||
protected override Transform[] RotatingElements => WorldObject.AttachedObject._interface._rotatingElements;
|
||||
|
||||
protected override void Serialize(NetworkWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
var airlockInterface = WorldObject.AttachedObject._interface;
|
||||
writer.Write(airlockInterface._currentRotation);
|
||||
writer.Write(airlockInterface._rotatingSpeed);
|
||||
writer.Write(airlockInterface._rotatingDirection);
|
||||
}
|
||||
|
||||
protected override void Deserialize(NetworkReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
var airlockInterface = WorldObject.AttachedObject._interface;
|
||||
airlockInterface._currentRotation = reader.Read<float>();
|
||||
airlockInterface._rotatingSpeed = reader.Read<float>();
|
||||
airlockInterface._rotatingDirection = reader.Read<int>();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user