mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-18 13:23:05 +00:00
188bbad5e7
* syncing time * clients auto-sleep or pause to reach server's time * disabled manual sleep/pause for clients
26 lines
546 B
C#
26 lines
546 B
C#
using OWML.ModHelper.Events;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.TimeSync
|
|
{
|
|
public class PreserveTimeScale : MonoBehaviour
|
|
{
|
|
private void Start()
|
|
{
|
|
GlobalMessenger.AddListener("GamePaused", OnPause);
|
|
|
|
var campfires = GameObject.FindObjectsOfType<Campfire>();
|
|
foreach (var campfire in campfires)
|
|
{
|
|
campfire.SetValue("_canSleepHere", false);
|
|
}
|
|
}
|
|
|
|
private void OnPause()
|
|
{
|
|
Time.timeScale = 1;
|
|
}
|
|
|
|
}
|
|
}
|