DanielEverland/ScriptableObject-Architecture

Typed Events - HowTo

rosty6 opened this issue · 1 comments

I'm new with ScriptableObject-Architecture and so far I'm loving it.
I have an issue I don't know how to resolve it with Typed Events, I have for instance this code

 IntGameEvent damageDone;
damageDone.Raise(5);

And in the "receiver" GameObject I added the intEventListener, pointing to a function like:

void OnDamageDone(int damage) {
    Debug.Log($"Damage: {damage}");
}

The thing is that in the inspector I have to specify the int value, and this overrides the value in the Rais call.

How can I get the correct value (5 in this case)?

Thanks

I'm having this same issue using Unity version 2019.4.11, SOA version 1.7.0
(also tried reverting back to 2019.4.4 when it had worked previously, but its no longer working)

I don't remember seeing this debug value before. Any idea whats going on @DanielEverland ?

image
(the supplied value (4 in this image) is the one that is being passed to the handler function)

NEVERMIND, what I messed up is choosing a static parameter function instead of a dynamic one. Choose the dynamic function, not the static one!!
image