IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Conditions/UGUI/ButtonClicked.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

28 lines
686 B
C#

using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine.UI;
using UnityEngine;
namespace NodeCanvas.Tasks.Conditions
{
[Category("UGUI")]
public class ButtonClicked : ConditionTask
{
[RequiredField]
public BBParameter<UnityEngine.UI.Button> button;
protected override string info {
get { return string.Format("Button {0} Clicked", button.ToString()); }
}
protected override string OnInit() {
button.value.onClick.AddListener(OnClick);
return null;
}
protected override bool OnCheck() { return false; }
void OnClick() { YieldReturn(true); }
}
}