Hi,
You seem to be running into two connected issues. You’ll notice that the scripting example in the docs that you’ve linked has a static callback; the main issue is that your MonoPInvokeCallback has to be static. As a result of adding the static keyword to the callback, you’ll also notice that your line CurrentType = type; in the callback breaks. If you want to operate on non-static members like CurrentType, you need to pass them to the callback as user data, the same as you’ve done with the sound key. You cannot access them directly.
If the purpose of CurrentType is just to track the state of an event instance, not the callback type, you may find it more convenient to call eventInstance.getPlaybackState() instead. If you do need to tie some kind of behavior specifically to callback types, not just the event state, you can pass CurrentType as user data. Since you’re also passing the sound key as user data, you can use a struct or class to bundle multiple variables or method delegates together. The Timeline Callbacks Scripting Example in the Unity docs shows a basic example of using a struct in this way.
Hope this helps!