Hi, I was missing an action for Playmaker that could call/broadcast a global event.
Feel free to use it.
using UnityEngine;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
using HutongGames.PlayMaker;
using AC;
[System.Serializable]
public class ActionBroadcastPlayMakerEvent : AC.Action
{
public string eventName;
public override AC.ActionCategory Category { get { return AC.ActionCategory.ThirdParty; } }
public override string Title { get { return "PlayMaker: Broadcast Event"; } }
public override string Description { get { return "Broadcasts an event to all PlayMaker FSMs."; } }
public override float Run()
{
if (!string.IsNullOrEmpty(eventName))
{
PlayMakerFSM.BroadcastEvent(eventName);
}
else
{
Debug.LogWarning("Event name is empty, cannot broadcast event.");
}
return 0f;
}
#if UNITY_EDITOR
public override void ShowGUI(List<AC.ActionParameter> parameters)
{
eventName = EditorGUILayout.TextField("Event Name:", eventName);
}
public override string SetLabel()
{
return $"Broadcast PlayMaker Event: {eventName}";
}
#endif
}
It looks like you're new here. If you want to get involved, click one of these buttons!