Added functionality for queueing actions on the Unity main thread