所有Simple UI Element,以及Composite Parameter Window初步
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
public class DynamicUIStringUnit : DynamicUICompositeUnit
|
||||
{
|
||||
public TMP_InputField stringInputField;
|
||||
|
||||
public override void SetUnit(CompositeParameterWindow list, object itemContent)
|
||||
{
|
||||
compositeParameterWindow = list;
|
||||
stringInputField.text = (string)itemContent;
|
||||
stringInputField.onEndEdit.AddListener(_ => compositeParameterWindow.ApplyParameters());
|
||||
removeButton.onClick.AddListener(() =>
|
||||
{
|
||||
compositeParameterWindow.RemoveUnit(this);
|
||||
compositeParameterWindow.ApplyParameters();
|
||||
});
|
||||
}
|
||||
|
||||
public string GetValue()
|
||||
{
|
||||
return stringInputField.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user