Improved adding and removal of anim events

This commit is contained in:
AbstractConcept 2022-09-17 19:06:33 -05:00
parent f0d46df3d6
commit 8523abf957
276 changed files with 1401 additions and 5422 deletions

View file

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace RimWorldAnimationStudio
{
public class SelectAnimationDialog : DialogBox
{
public void Initialize(Defs defs)
{
Transform contentWindow = transform.FindDeepChild("Content");
Reset();
for (int i = 0; i < defs.animationDefs.Count; i++)
{
AnimationDef animationDef = defs.animationDefs[i];
Transform _optionButton = AddCloneObjectToParent(contentWindow).transform;
_optionButton.Find("Text").GetComponent<Text>().text = animationDef.defName;
Button buttonComp = _optionButton.GetComponent<Button>();
buttonComp.onClick.AddListener(delegate { Pop(); ApplicationManager.Instance.LoadAnimation(animationDef); });
}
}
public void Reset()
{
Transform contentWindow = transform.FindDeepChild("Content");
RemoveCloneObjectsFromParent(contentWindow);
}
}
}