mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Multi-drag and stretching for keyframes
This commit is contained in:
parent
f449a9b4e2
commit
ab5a2a4c02
151 changed files with 195 additions and 85 deletions
|
@ -34,15 +34,14 @@ namespace RimWorldAnimationStudio
|
|||
HeadBob.Clear();
|
||||
GenitalAngle.Clear();
|
||||
|
||||
int keyframePosition = 0;
|
||||
int duration = 0;
|
||||
|
||||
keyframes[keyframes.Count - 1].tickDuration = 1;
|
||||
|
||||
foreach (PawnKeyframe frame in keyframes)
|
||||
{ duration += frame.tickDuration; }
|
||||
|
||||
int keyframePosition = 0;
|
||||
|
||||
keyframes[keyframes.Count - 1].tickDuration = 1;
|
||||
|
||||
for (int i = 0; i < keyframes.Count; i++)
|
||||
{
|
||||
PawnKeyframe keyframe = keyframes[i];
|
||||
|
@ -82,7 +81,7 @@ namespace RimWorldAnimationStudio
|
|||
quiver.Add(keyframePosition + keyframe.tickDuration - 1, false);
|
||||
}
|
||||
|
||||
keyframe.atTick = keyframePosition + 1;
|
||||
keyframe.atTick = keyframePosition + Constants.minTick;
|
||||
keyframePosition += keyframe.tickDuration;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Linq;
|
|||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace RimWorldAnimationStudio
|
||||
{
|
||||
|
@ -45,5 +46,10 @@ namespace RimWorldAnimationStudio
|
|||
|
||||
public bool HasValidKeyframeID()
|
||||
{ return keyframeID >= 100000 && keyframeID < 1000000; }
|
||||
|
||||
public KeyframeSlider GetKeyframeSlider()
|
||||
{
|
||||
return Selectable.allSelectablesArray.FirstOrDefault(x => x.GetComponent<KeyframeSlider>()?.keyframeID == keyframeID)?.GetComponent< KeyframeSlider>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue