Expanded menus and bug fixes

This commit is contained in:
AbstractConcept 2022-10-15 01:00:47 -05:00
parent cc28ac4bd4
commit 721443592f
146 changed files with 5891 additions and 269 deletions

View file

@ -22,28 +22,22 @@ namespace RimWorldAnimationStudio
this.actorID = actorID;
PawnAnimationClip clip = Workspace.Instance.GetPawnAnimationClip(actorID);
clip.BuildSimpleCurves();
if (clip == null || clip.keyframes.NullOrEmpty())
{
clip = new PawnAnimationClip();
clip.keyframes.Add(new PawnKeyframe());
clip.BuildSimpleCurves();
}
foreach (KeyframeSlider slider in GetComponentsInChildren<KeyframeSlider>())
{ RemovePawnKeyFrame(slider.keyframeID);}
foreach (PawnKeyframe keyframe in clip.keyframes)
{
KeyframeSlider keyframeSlider = Instantiate(keyframeSliderPrefab, transform);
keyframeSlider.Initialize(this, actorID, keyframe.keyframeID);
}
{ AddPawnKeyFrame(keyframe.keyframeID); }
int keyframeCount = clip.keyframes.Count;
/*int keyframeCount = clip.keyframes.Count;
int childCount = GetComponentsInChildren<KeyframeSlider>().Count();
for (int i = 0; i < Mathf.Max(keyframeCount, childCount); i++)
{
// Add new keyframe sliders as required
if (i >= childCount)
{ Instantiate(keyframeSliderPrefab, transform); }
{ AddPawnKeyFrame(clip.keyframes[i].keyframeID); }
// Get objects to update
KeyframeSlider keyframeSlider = GetComponentsInChildren<KeyframeSlider>()[i];
@ -54,8 +48,8 @@ namespace RimWorldAnimationStudio
// Remove excess objects as required
else
{ Destroy(keyframeSlider.gameObject); }
}
{ RemovePawnKeyFrame(GetComponentsInChildren<KeyframeSlider>()[i].keyframeID); }
}*/
}
public void AddPawnKeyFrame(int keyframeID)