WWebViewListener.cs 904 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using UnityEngine;
  3. namespace ICODES.STUDIO.WWebView
  4. {
  5. public class WWebViewListener : MonoBehaviour
  6. {
  7. public WWebView WebView { get; set; }
  8. public string Name
  9. {
  10. get
  11. {
  12. return base.gameObject.name;
  13. }
  14. }
  15. private void WebViewDone(string message)
  16. {
  17. this.WebView.InternalOnClose();
  18. }
  19. private void LoadBegin(string url)
  20. {
  21. this.WebView.InternalOnStartNavigation(url);
  22. }
  23. private void LoadComplete(string message)
  24. {
  25. this.WebView.InternalOnNavigationCompleted(message);
  26. }
  27. private void EvalJavaScriptFinished(string result)
  28. {
  29. this.WebView.InternalOnEvaluateJavaScript(result);
  30. }
  31. private void ReceivedMessage(string result)
  32. {
  33. this.WebView.InternalOnReceiveMessage(result);
  34. }
  35. [Serializable]
  36. public class WWebViewResultPayload
  37. {
  38. public string identifier;
  39. public string resultCode;
  40. public string data;
  41. }
  42. }
  43. }