Below is a script used in Unity for us. The Event / Delegate does what is expected on the C# side, but, have yet to see it recognize and react to the event on NC side. I’m assuming the structure but need a pointer how to get it rolling in the BT’s.
Thanks in advance guy.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EventManager : MonoBehaviour
{
public delegate void FireControl(bool fire);
public static event FireControl onFireEvent;
public static void FireEvent(bool fire)
{
if (onFireEvent != null)
onFireEvent(fire);
}
}
Do you mean recognized by the CheckEvent condition task?
If so, the CheckEvent can currently, only work with delegate types of “System.Action”, while the CheckEvent, with delegate types of “System.Action“, like so: public static event System.Action<bool> onFireEvent;
For your information, I am already looking at correctly supporting any delegate type instead of only System.Action by the way.
I was thinking that was the case with the requirement of the use Action. Can get around it for now, but, more specifically are the limitations of the Events & delegates as it relates to the C# environment? I’ve heard there’s a long list of possible Event tasks and conditions. What’s the primer on the NC side and how to use them?