2020-02-28 22:07:39 +01:00
|
|
|
|
using OWML.ModHelper.Events;
|
|
|
|
|
using UnityEngine;
|
2020-02-18 21:32:26 +01:00
|
|
|
|
|
2020-02-24 19:55:16 +01:00
|
|
|
|
namespace QSB.TimeSync
|
2020-02-18 21:32:26 +01:00
|
|
|
|
{
|
2020-02-28 22:07:39 +01:00
|
|
|
|
public class PreserveTimeScale : MonoBehaviour
|
2020-02-18 21:32:26 +01:00
|
|
|
|
{
|
2020-02-28 22:07:39 +01:00
|
|
|
|
private void Start()
|
2020-02-18 21:32:26 +01:00
|
|
|
|
{
|
2020-02-28 22:07:39 +01:00
|
|
|
|
GlobalMessenger.AddListener("GamePaused", OnPause);
|
|
|
|
|
|
|
|
|
|
var campfires = GameObject.FindObjectsOfType<Campfire>();
|
|
|
|
|
foreach (var campfire in campfires)
|
2020-02-18 21:32:26 +01:00
|
|
|
|
{
|
2020-02-28 22:07:39 +01:00
|
|
|
|
campfire.SetValue("_canSleepHere", false);
|
2020-02-18 21:32:26 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-28 22:07:39 +01:00
|
|
|
|
|
|
|
|
|
private void OnPause()
|
|
|
|
|
{
|
|
|
|
|
Time.timeScale = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 21:32:26 +01:00
|
|
|
|
}
|
|
|
|
|
}
|