// Class declaration
[System.Serializable]
public class MyEvent : UnityEvent<int> {}
// Somewhere in a component
// Declare
public MyEvent PressEvent;
// Invoke
int someValue = 123;
PressEvent.Invoke(someValue);
When Invoke is called, the argument received by callback function is always equals to the value showing in inspector.
Is there any way to invoke with dynamic arguments?
Thanks.
HI. In the inspector for the element you will notice there are two sections. Static and Dynamic. Dynamic calls use the value from the invoke, and static use the value you have manually set. You need to point to the dynamic call for this to work.