Gotchas

Dynamic Event Gotchas

  • If invoked method is async void or async Task you will not get an exception in some cases, but the GameObject/UI element will be modified on a separate thread, and you will not see the changes on the Gameobject or in the UI because those can only be modified from the main thread.

  • If multiple async event invoked methods are attempting to modify the same Gameobject you may see the changes passed between the methods if the async Task/void are called on the same thread, but the changes will never affect the main thread. Also, you may not see exceptions when using async void because it is treated as "fire and forget" and a Task is never returned. So, if you are accessing Game Objects or UI don't use async events!!! You can still use Dynamic Events, just use the Synchronous version

  • As of right now using DynamicEvents will work on public, private, and static methods. Gotcha - If the method and class is static an exception may be thrown. I have yet to test this out but be warned.

  • Dynamic events dont work on internal classes (test it out)

  • Dynamic events are invoked with the method you are calling. If you do

Last updated