Code refactor

This commit is contained in:
AbstractConcept 2022-10-31 00:44:53 -05:00
parent 5ca7e486f8
commit e14a12f2ab
310 changed files with 4875 additions and 4102 deletions

View file

@ -34,6 +34,12 @@ namespace RimWorldAnimationStudio
UpdateGUI();
}
public void ClearKeyframeSliders()
{
foreach (KeyframeSlider slider in GetComponentsInChildren<KeyframeSlider>())
{ Destroy(slider.gameObject); }
}
public void UpdateGUI()
{
if (actorID < 0) return;
@ -43,8 +49,7 @@ namespace RimWorldAnimationStudio
clip.BuildSimpleCurves();
foreach (KeyframeSlider slider in GetComponentsInChildren<KeyframeSlider>())
{ RemovePawnKeyFrame(slider.keyframeID); }
ClearKeyframeSliders();
foreach (PawnKeyframe keyframe in clip.Keyframes)
{ AddPawnKeyFrame(keyframe.keyframeID); }