Table of contents

Create #

using UnityEngine;
using ArushaSoft.GenericEventSystem;

public class MyGenericEvent : MonoBehaviour ,IEvent
{
    private CustomEvent<int> OnDamage = new CustomEvent<int>();
    private CustomEvent<Vector3 , float> OnPositionUpdate = new CustomEvent<Vector3 , float>();

    public void AddEvent(EventList eventList)
    {
        eventList.Add(OnDamage, nameof(OnDamage));
        eventList.Add(OnPositionUpdate , nameof(OnPositionUpdate));
    }
}

Invoke #

        OnDamage?.Invoke(20);
        OnPositionUpdate?.Invoke(Vector3.zero, 52f);

What are your feelings
Updated on May 21, 2022