三种动画参数的Composite Unit

This commit is contained in:
SoulliesOfficial
2025-02-13 14:26:37 -05:00
parent 96a4d620f5
commit 0bcc843740
22 changed files with 8273 additions and 51 deletions

View File

@@ -1,18 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
public class DynamicUIAnimatedIntUnit : MonoBehaviour
namespace Ichni.Editor
{
// Start is called before the first frame update
void Start()
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());
// Update is called once per frame
void Update()
{
removeButton.onClick.AddListener(() =>
{
compositeParameterWindow.RemoveUnit(this);
compositeParameterWindow.ApplyParameters();
});
}
public AnimatedInt GetValue()
{
return new AnimatedInt(float.Parse(timeInputField.text), int.Parse(valueInputField.text));
}
}
}
}