37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.Editor
|
|
{
|
|
public class DynamicUIAnimatedIntUnit : DynamicUICompositeUnit
|
|
{
|
|
public TMP_InputField timeInputField;
|
|
public TMP_InputField valueInputField;
|
|
|
|
public override void SetUnit(CompositeParameterWindow window, object itemContent)
|
|
{
|
|
compositeParameterWindow = window;
|
|
|
|
AnimatedInt animatedInt = (AnimatedInt)itemContent;
|
|
timeInputField.text = animatedInt.time.ToString();
|
|
valueInputField.text = animatedInt.value.ToString();
|
|
|
|
timeInputField.onEndEdit.AddListener(_ => compositeParameterWindow.ApplyParameters());
|
|
valueInputField.onEndEdit.AddListener(_ => compositeParameterWindow.ApplyParameters());
|
|
|
|
removeButton.onClick.AddListener(() =>
|
|
{
|
|
compositeParameterWindow.RemoveUnit(this);
|
|
compositeParameterWindow.ApplyParameters();
|
|
});
|
|
}
|
|
|
|
public AnimatedInt GetValue()
|
|
{
|
|
return new AnimatedInt(float.Parse(timeInputField.text), int.Parse(valueInputField.text));
|
|
}
|
|
}
|
|
} |