c# custom UnitCategory for events

I Used a simple class for my custom event. After saving the script and regenerate units in Protect Settings I have Game->Events->"EmptyCategory" without the event in fuzzy finder.

I trying [UnitCategory("Game/Events/Global")] and [UnitCategory("Game\Events\Global")] - have same result.

It's a bug or I doing something wrong?

[UnitTitle("OnTriggerPlayerEnter")]
[UnitCategory("Game\\Events\\Global")]
public class TriggerPlayerEnterEvent : GameObjectEventUnit<PlayerCharacter>
{
    [DoNotSerialize]
    public ValueOutput player { get; private set; }

    protected override string hookName => CustomEventNames.TriggerPlayerEnterEvent;
    public override Type MessageListenerType => null;

    protected override void Definition()
    {
        base.Definition();

        player = ValueOutput<PlayerCharacter>(nameof(player));
    }

    protected override void AssignArguments(Flow flow, PlayerCharacter data)
    {
        flow.SetValue(player, data);
    }
}

Events are special snowflakes at the moment. they need to be the Event folder. You will need to set them like this to see them. Or you will only be able to find them by typing the name of the event node.
[UnitCategory("Events\\Game\\Global")]

Thanks for the info.

I hope in the future it will be possible to create your own category and move all there. This is a very useful thing when we write nodes and events for designers and group them in one place.

1 Like