mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-11 18:41:59 +00:00
23 lines
790 B
C#
23 lines
790 B
C#
using OWML.Utils;
|
|
using QSB.Patches;
|
|
|
|
namespace QSB.TimeSync.Patches
|
|
{
|
|
public class WakeUpPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnNonServerClientConnect;
|
|
|
|
public static bool OnStartOfTimeLoopPrefix(ref PlayerCameraEffectController __instance)
|
|
{
|
|
if (__instance.gameObject.CompareTag("MainCamera") && QSBSceneManager.CurrentScene != OWScene.EyeOfTheUniverse)
|
|
{
|
|
__instance.Invoke("WakeUp");
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override void DoPatches() => QSBCore.Helper.HarmonyHelper.AddPrefix<PlayerCameraEffectController>("OnStartOfTimeLoop", typeof(WakeUpPatches), nameof(OnStartOfTimeLoopPrefix));
|
|
|
|
public override void DoUnpatches() => QSBCore.Helper.HarmonyHelper.Unpatch<PlayerCameraEffectController>("OnStartOfTimeLoop");
|
|
}
|
|
} |