rotation, quick reset, better handling of offset values

This commit is contained in:
Platinum 2020-05-30 14:10:22 -07:00
parent 2e18be1953
commit f22f5ac33e
6 changed files with 66 additions and 26 deletions

View file

@ -44,11 +44,6 @@ namespace Rimworld_Animations {
bodyAnim.tickGraphics(graphics);
bodyAnim.animatePawn(ref rootLoc, ref angle, ref bodyFacing, ref headFacing);
if(bodyAnim.CurrentAnimation?.actors[bodyAnim.ActorIndex]?.offsetsByDefName != null && bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName.ContainsKey(pawn.def.defName)) {
rootLoc.x += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[pawn.def.defName].x;
rootLoc.z += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[pawn.def.defName].y;
}
}
}

View file

@ -18,11 +18,6 @@ namespace Rimworld_Animations {
if (bodyAnim != null && bodyAnim.isAnimating) {
__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 true;