mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
changed drawtracker to move with offset
This commit is contained in:
parent
0f13261545
commit
218e4426c8
2 changed files with 9 additions and 1 deletions
Binary file not shown.
|
@ -13,8 +13,16 @@ namespace Rimworld_Animations {
|
||||||
public static class HarmonyPatch_Pawn_DrawTracker {
|
public static class HarmonyPatch_Pawn_DrawTracker {
|
||||||
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
|
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
|
||||||
|
|
||||||
if(___pawn.TryGetComp<CompBodyAnimator>() != null && ___pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
|
CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();
|
||||||
|
|
||||||
|
if (bodyAnim != null && bodyAnim.isAnimating) {
|
||||||
__result = ___pawn.TryGetComp<CompBodyAnimator>().anchor + ___pawn.TryGetComp<CompBodyAnimator>().deltaPos;
|
__result = ___pawn.TryGetComp<CompBodyAnimator>().anchor + ___pawn.TryGetComp<CompBodyAnimator>().deltaPos;
|
||||||
|
|
||||||
|
if (bodyAnim.CurrentAnimation?.actors[bodyAnim.ActorIndex]?.offsetsByDefName != null && bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName.ContainsKey(___pawn.def.defName)) {
|
||||||
|
__result.x += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].x;
|
||||||
|
__result.z += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].y;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue