Ricardo Lopes 49227bf5c9
Remove dependency on "wake up" events (#68)
* Remove wake up dependency from transform sync

* Remove wake up dependency for all synced transforms

* Remove comments

* Remove obsolete QSBBehaviour component

* Remove wakeup dependency in RespawnOnDeath

* Prevent errors on MessageHandler and RespawnOnDeath when network not initialized

* Add RespawnOnDeath only after network is initialized

* wip

* Prevent trying to add animator components multiple times

* Reset sectors on scene load

* Reset transform sync on scene change

* Remove comment

* Remove wakeup event dependency from WakeUpSync

* Sync loop count
2020-03-13 20:44:32 +01:00

26 lines
630 B
C#

using QSB.Messaging;
using UnityEngine.Networking;
namespace QSB.TimeSync
{
public class WakeUpMessage : QSBMessage
{
public override MessageType MessageType => MessageType.WakeUp;
public float ServerTime { get; set; }
public int LoopCount { get; set; }
public override void Deserialize(NetworkReader reader)
{
ServerTime = reader.ReadSingle();
LoopCount = reader.ReadInt16();
}
public override void Serialize(NetworkWriter writer)
{
writer.Write(ServerTime);
writer.Write(LoopCount);
}
}
}