三种动画参数的Composite Unit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user