mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
26 lines
688 B
C#
26 lines
688 B
C#
using HarmonyLib;
|
|
using rjw;
|
|
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace Rimworld_Animations {
|
|
|
|
[HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
|
|
public static class HarmonyPatch_Pawn_DrawTracker {
|
|
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
|
|
|
|
|
|
CompExtendedAnimator animator = ___pawn.TryGetComp<CompExtendedAnimator>();
|
|
|
|
//align pos on top of partner, position, etc., based on animatoranchor
|
|
if (animator != null && animator.IsAnchored)
|
|
{
|
|
__result = animator.getAnchor();
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
}
|
|
}
|