mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Expanded menus and bug fixes
This commit is contained in:
parent
cc28ac4bd4
commit
721443592f
146 changed files with 5891 additions and 269 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue