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(); } }
private void MyMethod(int a) { myCustomEvent.Invoke(a); }