mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Key snapping
This commit is contained in:
parent
5436410162
commit
f275ed90ae
101 changed files with 253 additions and 117 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue