quantum-space-buddies/QSB/TimeSync/WakeUpPatches.cs

24 lines
757 B
C#
Raw Normal View History

using OWML.ModHelper.Events;
2020-08-13 21:06:34 +00:00
namespace QSB.TimeSync
{
2020-11-03 21:11:10 +00:00
public class WakeUpPatches : QSBPatch
2020-08-13 21:06:34 +00:00
{
2020-11-03 21:11:10 +00:00
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect;
2020-08-13 21:06:34 +00:00
public static bool OnStartOfTimeLoopPrefix(ref PlayerCameraEffectController __instance)
{
2020-08-16 20:39:21 +00:00
if (__instance.gameObject.CompareTag("MainCamera") && QSBSceneManager.CurrentScene != OWScene.EyeOfTheUniverse)
2020-08-13 21:06:34 +00:00
{
__instance.Invoke("WakeUp");
2020-08-13 21:06:34 +00:00
}
return false;
}
2020-11-03 21:11:10 +00:00
public override void DoPatches()
{
QSB.Helper.HarmonyHelper.AddPrefix<PlayerCameraEffectController>("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix));
}
2020-08-13 21:06:34 +00:00
}
}