quantum-space-buddies/QSB/TimeSync/PreserveTimeScale.cs
Ricardo Lopes e690958f0f
Fast forward speed proportional to client / server time diff (#74)
* 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

* Fast forward speed dependent on difference between client and server time

* Lerp on update

* Change fastforward condition

* Update WakeUpSync.cs
2020-03-14 15:42:51 +01:00

27 lines
592 B
C#

using OWML.ModHelper.Events;
using UnityEngine;
using UnityEngine.Networking;
namespace QSB.TimeSync
{
public class PreserveTimeScale : NetworkBehaviour
{
private void Start()
{
QSB.Helper.Menus.PauseMenu.GetButton("Button-EndCurrentLoop").Hide();
if (isServer)
{
return;
}
var campfires = GameObject.FindObjectsOfType<Campfire>();
foreach (var campfire in campfires)
{
campfire.SetValue("_canSleepHere", false);
}
}
}
}