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