Exemple #1
0
    /// <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);
    }
Exemple #2
0
    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;
    }
Exemple #3
0
 /// <summary>
 /// Closes the popup.
 /// </summary>
 public static void ClosePopup(UWKPopup p)
 {
     CloseJSPopupRequested(p);
 }
Exemple #4
0
    /// <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);
    }
Exemple #5
0
 /// <summary>
 /// Closes the popup.
 /// </summary>
 public static void ClosePopup(UWKPopup p)
 {
     CloseJSPopupRequested (p);
 }