Key snapping

This commit is contained in:
AbstractConcept 2022-10-03 21:45:52 -05:00
parent 5436410162
commit f275ed90ae
101 changed files with 253 additions and 117 deletions

View file

@ -128,6 +128,15 @@ namespace RimWorldAnimationStudio
interactable = true;
base.OnDrag(eventData);
int targetTick = Workspace.FindClosestKeyFrameAtTick(keyframe.atTick.Value, Mathf.CeilToInt(Workspace.StageWindowSize * 0.01f), actorID);
if (Input.GetKey(KeyCode.LeftShift) && Workspace.Instance.DoesPawnKeyframeExistAtTick(Workspace.stageID, actorID, targetTick) == false)
{ value = (float)targetTick; }
// Prevent frames from being moved to tick 1
if (value == 1)
{ value = 2; }
//AnimationController.Instance.stageTick = keyframe.atTick.Value;
Workspace.actorID = actorID;
}