Exemple #1
0
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                //Built-in
                //myCoolEvent?.Invoke(this, null);

                //MyCoolEventWithParameters?.Invoke(this, new MyName("InsertFunnyName"));

                //MyCoolEventAction?.Invoke(new MyName("InsertFunnyName"), new MyAge(5));

                //CoolUnityEvent?.Invoke();

                coolCustomUnityEvent?.Invoke(new MyName("InsertFunnyName"), new MyAge(5));

                //Custom
                //MyCoolCustomEvent?.Invoke(this, null);

                //MyCoolCustomEvent?.Invoke();
            }
        }
Exemple #2
0
 private void MyMethod(int a)
 {
     myCustomEvent.Invoke(a);
 }