Trouble with which Event Condition to use

NodeCanvas Forums Support Trouble with which Event Condition to use

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12866
    emmcd333@gmail.com
    Participant

    Hey Gav,

    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);
    }
    }

    #12877
    Gavalakis
    Keymaster

    Hey!

    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.

    Let me know if that works for you.
    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

    #12885
    emmcd333@gmail.com
    Participant

    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?

    Cheers again!

    #12892
    Gavalakis
    Keymaster

    Hello again,

    Can you please rephrase your last questions? 🙂
    “What’s the primer on the NC side and how to use them?”

    Thank you.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.