Show() public method

Makes the page visible, the page will be updated and refreshed by the Wweb rendering process
public Show ( ) : void
return void
Beispiel #1
0
    void windowFunction(int windowID)
    {
        int  titleHeight = 24;
        Rect titleRect   = new Rect(0, 0, Width + 16, titleHeight);

        GUI.DragWindow(titleRect);

        GUILayout.BeginVertical();

        GUIStyle style = new GUIStyle(GUI.skin.textArea);

        style.fontSize = 24;

        string text = @"This example shows everything needed to implement a login to Facebook dialog using uWebKit2";

        GUILayout.TextArea(text, style);

        if (state == State.Start)
        {
            if (GUILayout.Button(LoginTexture))
            {
                if (accessToken == "")
                {
                    view.Show();
                    state = State.Login;
                }
                else
                {
                    handleLoggedIn();
                }
            }

            GUILayout.Space(64);

            if (GUILayout.Button("Clear\nCookies", GUILayout.MaxWidth(100)))
            {
                UWKCore.ClearCookies();
            }
        }
        else if (state == State.Login)
        {
            GUILayout.Box(view.WebTexture);

            if (Event.current.type == EventType.Repaint)
            {
                browserRect = GUILayoutUtility.GetLastRect();

                browserRect.x += windowRect.x;
                browserRect.y += windowRect.y;

                scale.x = (float)Width / (float)browserRect.width;
                scale.y = (float)Height / (float)browserRect.height;
            }
        }
        else if (state == State.LoggedIn)
        {
        }

        GUILayout.EndVertical();
    }