I’m currently looking for a way to implement callbacks which also have a wiggle room to be able to call multiple callbacks and something that appears in the Inspector, and I remember PlayerInput has an amazing feature if you set it to “Invoke Unity Events” behavior and saw that this amazing feature is called CallbackContext. When I looked around, it seems like it’s tied to InputAction and was kinda disappointed.
It’s just a struct nested within InputAction
, it doesn’t mean it’s ‘coupled’. It’s just a parameter you need in the signature of methods that you subscribe to the various InputAction callbacks.
Sure, it might not be really coupled with InputAction, but it still means it’s owned by InputAction. So I don’t think it would be smart to just use it on it’s own just because you can. And well, I don’t really need/want to interact with InputAction to trigger the callbacks. Well, it is surely involved in the process, but I have a bit more processing before I want to call the callbacks.
But why?
I think I already found what I need. It seems like UnityEvent would work just like CallbackContext. Will test it out tomorrow
Emm, because it wasn’t it’s intended purpose? And it has some caveats that I don’t want/need to deal with. So I’d rather find a tool/feature that is much more suited to what I want to do. And I haven’t exhausted my options yet, so I don’t want to use it yet.