34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Xml;
|
|
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace Rimworld_Animations_Patch
|
|
{
|
|
public class Motion_StrokeGenitalsUpAndDown_FacingNS : HandMotion
|
|
{
|
|
public override Vector3 GetHandPosition(Pawn pawn, HandAnimationData handAnimationData, float baseAngle)
|
|
{
|
|
Vector3 handPosition = new Vector3();
|
|
ActorAnimationData data = pawn.GetAnimationData();
|
|
|
|
float p = (Mathf.PingPong(data.stageTicks, handAnimationData.cycleTime) / handAnimationData.cycleTime);
|
|
float size = HandAnimationUtility.GetGenitalSize(pawn, handAnimationData.targetBodyPart) * 0.2f;
|
|
float m = (data.actorFacing == Rot4.North ? -1f : 1f) * (handAnimationData.mirror ? -1f : 1f) * (data.isMirrored ? -1f : 1f);
|
|
|
|
handPosition.x = 0.025f * m;
|
|
handPosition.z = size * p;
|
|
|
|
handPosition = handPosition.RotatedBy(baseAngle);
|
|
|
|
return handPosition;
|
|
}
|
|
}
|
|
}
|