Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #if UNITY_WEBGL && !UNITY_EDITOR
  2.  
  3. using System;
  4. using System.Runtime.InteropServices;
  5. using AOT;
  6.  
  7. public static class WebGLBridge {
  8. public static event Action OnReady;
  9.  
  10.  
  11. [DllImport("__Internal")]
  12. private static extern void Init(Action onReady);
  13.  
  14. #region Handlers
  15.  
  16. [MonoPInvokeCallback(typeof(Action))]
  17. private static void ReadyHandler() {
  18. OnReady?.Invoke();
  19. }
  20.  
  21. #endregion
  22. }
  23.  
  24. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement