SHA256
44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using HarmonyLib;
|
|
using UnityEngine;
|
|
|
|
namespace ADOFAIRenderer.Patch.Game
|
|
{
|
|
[HarmonyPatch(typeof(scrFloor))]
|
|
// ReSharper disable once InconsistentNaming
|
|
public static class scrFloorPortalPatch
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch("SpawnPortalParticles")]
|
|
public static bool SkipPortalInNonTileRender()
|
|
{
|
|
// 논타일 렌더링 중에는 마지막 타일의 종료 포탈을 아예 생성하지 않습니다.
|
|
return !Core.NonTileHider.SuppressPortal;
|
|
}
|
|
}
|
|
|
|
[HarmonyPatch(typeof(scrPortalParticles))]
|
|
// ReSharper disable once InconsistentNaming
|
|
public static class scrPortalParticlesPatch
|
|
{
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch("Start")]
|
|
// ReSharper disable once InconsistentNaming
|
|
public static void ForceScaledTime(scrPortalParticles __instance)
|
|
{
|
|
// 렌더링 중에만 필요한 조치입니다. 일반 플레이에서 적용하면
|
|
// 일시정지(timeScale=0) 시 바닐라가 unscaled로 만든 파티클까지 얼어붙습니다.
|
|
if (!Core.RenderManager.IsActive) return;
|
|
if (__instance == null) return;
|
|
|
|
var particleSystems = __instance.GetComponentsInChildren<ParticleSystem>(true);
|
|
foreach (var ps in particleSystems)
|
|
{
|
|
if (ps == null) continue;
|
|
|
|
var main = ps.main;
|
|
main.useUnscaledTime = false;
|
|
}
|
|
}
|
|
}
|
|
}
|