三种动画参数的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,38 @@
using System.Collections;
using System.Collections.Generic;
using Ichni.RhythmGame;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class DynamicUIAnimatedBoolUnit : MonoBehaviour
namespace Ichni.Editor
{
// Start is called before the first frame update
void Start()
public class DynamicUIAnimatedBoolUnit : DynamicUICompositeUnit
{
public TMP_InputField timeInputField;
public Toggle valueToggle;
}
public override void SetUnit(CompositeParameterWindow window, object itemContent)
{
compositeParameterWindow = window;
AnimatedBool animatedBool = (AnimatedBool)itemContent;
timeInputField.text = animatedBool.time.ToString();
valueToggle.isOn = animatedBool.value;
timeInputField.onEndEdit.AddListener(_ => compositeParameterWindow.ApplyParameters());
valueToggle.onValueChanged.AddListener(_ => compositeParameterWindow.ApplyParameters());
// Update is called once per frame
void Update()
{
removeButton.onClick.AddListener(() =>
{
compositeParameterWindow.RemoveUnit(this);
compositeParameterWindow.ApplyParameters();
});
}
public AnimatedBool GetValue()
{
return new AnimatedBool(float.Parse(timeInputField.text), valueToggle.isOn);
}
}
}
}