mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-18 13:23:05 +00:00
34 lines
741 B
C#
34 lines
741 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;
|
|
}
|
|
|
|
GlobalMessenger.AddListener("GamePaused", OnPause);
|
|
|
|
var campfires = GameObject.FindObjectsOfType<Campfire>();
|
|
foreach (var campfire in campfires)
|
|
{
|
|
campfire.SetValue("_canSleepHere", false);
|
|
}
|
|
}
|
|
|
|
private void OnPause()
|
|
{
|
|
Time.timeScale = 1;
|
|
}
|
|
|
|
}
|
|
}
|