2021-09-09 20:42:29 -04:00

30 lines
878 B
C#

using System;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
namespace UnityEditor.VFX.UI
{
class VFXStringFieldPushButton : VFXStringField
{
Action<string> m_fnOnClicked;
public Action<string> pushButtonProvider
{
get { return m_fnOnClicked; }
}
public VFXStringFieldPushButton(string label, Action<string> fnClicked, string buttonName) : base(label)
{
m_fnOnClicked = fnClicked;
Add(new Button(() => m_fnOnClicked(m_TextField.text)) {text = buttonName});
}
public VFXStringFieldPushButton(Label existingLabel, Action<string> fnClicked, string buttonName) : base(existingLabel)
{
m_fnOnClicked = fnClicked;
Add(new Button(() => m_fnOnClicked(m_TextField.text)) {text = buttonName});
}
}
}