However, it is possible to have UI Toolkit-based Buttons run AC ActionList asset files when clicked with this simple script:
using UnityEngine;
using UnityEngine.UIElements;
using AC;
public class ToolkitButtonActionList : MonoBehaviour
{
public string buttonName;
public ActionListAsset actionListAsset;
public UIDocument uiDocument;
void Start()
{
if (uiDocument == null) uiDocument = GetComponent<UIDocument>();
if (uiDocument == null) return;
var button = uiDocument.rootVisualElement.Q(buttonName) as UnityEngine.UIElements.Button;
button.RegisterCallback<ClickEvent>(OnClickButton);
}
void OnClickButton(ClickEvent clickEvent)
{
actionListAsset.Interact();
}
}
Comments
Built-in, only Unity uGUI.
However, it is possible to have UI Toolkit-based Buttons run AC ActionList asset files when clicked with this simple script:
Noted, thanks @ChrisIceBox