Files
BABA_YAGA/Assets/Invector-3rdPersonController/Basic Locomotion/Scripts/CharacterController/Actions/vTriggerActionEvent.cs
2026-05-30 09:16:35 +07:00

27 lines
822 B
C#

using Invector;
using Invector.vCharacterController.vActions;
using System.Collections.Generic;
[vClassHeader("Trigger Action Event", helpBoxText = "Use this to filter a specific TriggerAction so you can use Events with the Controller or components attached to the Controller", useHelpBox = true)]
public class vTriggerActionEvent : vMonoBehaviour
{
public List<ActionEvent> actionFinders;
public void TriggerEvent(vTriggerGenericAction action)
{
var _action = actionFinders.Find(a => a.actionName.Equals(action.gameObject.name));
if (_action != null)
{
_action.onTriggerEvent.Invoke();
}
}
[System.Serializable]
public class ActionEvent
{
public string actionName;
public UnityEngine.Events.UnityEvent onTriggerEvent;
}
}