Improve scrDecorationPatch Code Consistency

This commit is contained in:
copecone committed 2026-05-26 14:08:06 +09:00
1 parent 2eb26fe748
commit 5d7cfb68ea
1 file changed
+7 -21
+7 -21
View File
@@ -1,5 +1,4 @@
using HarmonyLib;
using UnityEngine;
namespace ADOFAIRenderer.Patch.ClassPatch
{
@@ -12,44 +11,31 @@ namespace ADOFAIRenderer.Patch.ClassPatch
// ReSharper disable once InconsistentNaming
public static bool SetRotationPrefix(scrDecoration __instance)
{
if (__instance == null || !__instance || __instance.pivotTrans == null)
{
return false;
}
return true;
return __instance != null && __instance && __instance.pivotTrans != null;
}
[HarmonyPrefix]
[HarmonyPatch("SetScale")]
// ReSharper disable once InconsistentNaming
public static bool SetScalePrefix(scrDecoration __instance)
{
if (__instance == null || !__instance || __instance.pivotTrans == null)
{
return false;
}
return true;
return __instance != null && __instance && __instance.pivotTrans != null;
}
[HarmonyPrefix]
[HarmonyPatch("SetOpacity")]
// ReSharper disable once InconsistentNaming
public static bool SetOpacityPrefix(scrDecoration __instance)
{
if (__instance == null || !__instance)
{
return false;
}
return true;
return __instance != null && __instance;
}
[HarmonyPrefix]
[HarmonyPatch("UpdatePosition")]
// ReSharper disable once InconsistentNaming
public static bool UpdatePositionPrefix(scrDecoration __instance)
{
if (__instance == null || !__instance || __instance.pivotTrans == null)
{
return false;
}
return true;
return __instance != null && __instance && __instance.pivotTrans != null;
}
}
}