2022-10-27 05:56:04 +00:00
|
|
|
|
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 AnimationDefCard : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public InputField defNameField;
|
|
|
|
|
public InputField labelField;
|
|
|
|
|
|
|
|
|
|
public void Start()
|
|
|
|
|
{
|
2022-10-28 05:28:51 +00:00
|
|
|
|
EventsManager.onAnimationChanged.AddListener(delegate { UpdateInputFields(); });
|
2022-10-27 05:56:04 +00:00
|
|
|
|
|
|
|
|
|
defNameField.onEndEdit.AddListener(delegate {
|
|
|
|
|
Workspace.animationDef.DefName = defNameField.text;
|
|
|
|
|
Workspace.MakeHistoricRecord("AnimationDef update");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
labelField.onEndEdit.AddListener(delegate {
|
|
|
|
|
Workspace.animationDef.Label = labelField.text;
|
|
|
|
|
Workspace.MakeHistoricRecord("AnimationDef update");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
UpdateInputFields();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInputFields()
|
|
|
|
|
{
|
|
|
|
|
defNameField.SetTextWithoutNotify(Workspace.animationDef.DefName);
|
|
|
|
|
labelField.SetTextWithoutNotify(Workspace.animationDef.Label);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|