UniWebViewFastEnterPlayMode.cs 829 B

12345678910111213141516171819202122232425262728
  1. #if UNITY_EDITOR
  2. using UnityEditor;
  3. public partial class UniWebView {
  4. internal static void ResetGlobalPayloadActionsForFastEnterPlayMode() {
  5. globalPayloadActions.Clear();
  6. }
  7. }
  8. [InitializeOnLoad]
  9. internal static class UniWebViewFastEnterPlayMode {
  10. // This keeps the editor-only callback class discoverable in the runtime assembly.
  11. static UniWebViewFastEnterPlayMode() {}
  12. [InitializeOnEnterPlayMode]
  13. private static void ResetStaticState(EnterPlayModeOptions options) {
  14. if ((options & EnterPlayModeOptions.DisableDomainReload) == 0) {
  15. return;
  16. }
  17. UniWebViewNativeListener.ResetListenersForFastEnterPlayMode();
  18. UniWebView.ResetGlobalPayloadActionsForFastEnterPlayMode();
  19. UniWebViewChannelMethodManager.ResetForFastEnterPlayMode();
  20. }
  21. }
  22. #endif