Multi-drag and stretching for keyframes

This commit is contained in:
AbstractConcept 2022-10-14 00:52:07 -05:00
parent f449a9b4e2
commit ab5a2a4c02
151 changed files with 195 additions and 85 deletions

View file

@ -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;
}
}

View file

@ -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>();
}
}
}