mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Sex props plus quiver visuals
This commit is contained in:
parent
f275ed90ae
commit
4a2905c7fc
152 changed files with 1985 additions and 184 deletions
|
@ -109,36 +109,20 @@ namespace RimWorldAnimationStudio
|
|||
return animationDef.animationStages[stageID].animationClips[actorID].keyframes.Any(x => x.atTick == atTick);
|
||||
}
|
||||
|
||||
public static void FindAdjacentKeyframes(int atTick, out PawnKeyframe prevKeyframe, out PawnKeyframe nextKeyframe, int actorID = -1, int excludedActorID = -1, bool ignoreSelf = true, int searchDistance = int.MaxValue)
|
||||
public PawnKeyframe GetCurrentOrPreviousKeyframe(int actorID)
|
||||
{
|
||||
prevKeyframe = null;
|
||||
nextKeyframe = null;
|
||||
PawnKeyframe pawnKeyframe = null;
|
||||
PawnAnimationClip clip = GetPawnAnimationClip(actorID);
|
||||
|
||||
List<PawnKeyframe> keyframesToCheck;
|
||||
int stageTick = AnimationController.Instance.stageTick;
|
||||
|
||||
if (actorID >= 0)
|
||||
{ keyframesToCheck = animationDef.animationStages[stageID].animationClips[actorID].keyframes; }
|
||||
|
||||
else
|
||||
foreach (PawnKeyframe keyframe in clip.keyframes)
|
||||
{
|
||||
keyframesToCheck = animationDef.animationStages[stageID].animationClips.Where(x =>
|
||||
animationDef.animationStages[stageID].animationClips.IndexOf(x) != excludedActorID).SelectMany(x => x.keyframes)?.ToList();
|
||||
if (keyframe.atTick <= stageTick)
|
||||
{ pawnKeyframe = keyframe; }
|
||||
}
|
||||
|
||||
foreach (PawnKeyframe keyframe in keyframesToCheck)
|
||||
{
|
||||
if (keyframe.atTick <= atTick && atTick - keyframe.atTick <= searchDistance)
|
||||
{
|
||||
if (keyframe.atTick != atTick || ignoreSelf)
|
||||
{ prevKeyframe = keyframe; }
|
||||
|
||||
else
|
||||
{ prevKeyframe = null; }
|
||||
}
|
||||
|
||||
if (nextKeyframe == null && keyframe.atTick > atTick && keyframe.atTick - atTick <= searchDistance)
|
||||
{ nextKeyframe = keyframe; }
|
||||
}
|
||||
return pawnKeyframe;
|
||||
}
|
||||
|
||||
public static int FindClosestKeyFrameAtTick(int atTick, int searchDistance = int.MaxValue, int excludedActorID = -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue