/// <summary> /// Closes the JS popup, this is generated from the UWKProcess in response to a javascript close call /// </summary> private static void CloseJSPopupRequested(UWKPopup p) { if (!popups.ContainsValue(p)) { Debug.LogWarning("Warning: CLoseJSPopupRequested called on mislinked popup"); return; } p.View.Remove(); string k = null; foreach (string s in popups.Keys) { if (popups [s] == p) { k = s; break; } } popups.Remove(k); UnityEngine.Object.DestroyObject(p.gameObject); UnityEngine.Object.DestroyObject(p); }
private static void CreateJSPopup(string name, int width, int height) { UWKView view = CreateViewInternal(name, width, height, true); view.JSPopup = true; GameObject go = new GameObject("UWKPopup_" + name); UnityEngine.Object.DontDestroyOnLoad(go); UWKPopup p = go.AddComponent <UWKPopup> (); p.View = view; popups [name] = p; }
/// <summary> /// Closes the popup. /// </summary> public static void ClosePopup(UWKPopup p) { CloseJSPopupRequested(p); }
/// <summary> /// Closes the JS popup, this is generated from the UWKProcess in response to a javascript close call /// </summary> private static void CloseJSPopupRequested(UWKPopup p) { if (!popups.ContainsValue (p)) { Debug.LogWarning ("Warning: CLoseJSPopupRequested called on mislinked popup"); return; } p.View.Remove (); string k = null; foreach (string s in popups.Keys) { if (popups [s] == p) { k = s; break; } } popups.Remove (k); UnityEngine.Object.DestroyObject (p.gameObject); UnityEngine.Object.DestroyObject (p); }
/// <summary> /// Closes the popup. /// </summary> public static void ClosePopup(UWKPopup p) { CloseJSPopupRequested (p); }