Ejemplo n.º 1
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            loading = false;
        }

        usernameFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        username        = GUI.TextField(usernameFieldRect, username, usernameStyle);

        passwordFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == passwordFieldID || password != kDefaultPasswordText)
        {
            password = GUI.PasswordField(passwordFieldRect, password, '*', passwordStyle);
        }
        else
        {
            password = GUI.TextField(passwordFieldRect, password, passwordStyle);
        }

        confirmFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == confirmFieldID || confirm != kDefaultConfirmText)
        {
            confirm = GUI.PasswordField(confirmFieldRect, confirm, '*', confirmStyle);
        }
        else
        {
            confirm = GUI.TextField(confirmFieldRect, confirm, confirmStyle);
        }

        emailFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        email        = GUI.TextField(emailFieldRect, email, emailStyle);

        if (GUI.Button(submitButtonRect, "Submit", buttonStyle))
        {
            ClearFocus();
            ADAGEMenu.ShowPanel <ADAGESplashPanel>();
            if (IsValid())
            {
                ADAGE.RegisterPlayer(username, email, password, confirm);
            }
        }

        if (GUI.Button(backButtonRect, "Back", buttonStyle))
        {
            ClearFocus();
            ADAGEMenu.ShowLast();
        }

        CheckFields();
    }
Ejemplo n.º 2
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            CheckFields();
            loading = false;
        }

        usernameFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        username        = GUI.TextField(usernameFieldRect, username, usernameStyle);

        passwordFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == passwordFieldID || password != kDefaultPasswordText)
        {
            password = GUI.PasswordField(passwordFieldRect, password, '*', passwordStyle);
        }
        else
        {
            password = GUI.TextField(passwordFieldRect, password, passwordStyle);
        }

        GUI.enabled = (password != kDefaultPasswordText && username != kDefaultUsernameText && password.Trim().Length != 0 && username.Trim().Length != 0);
        if (GUI.Button(loginButtonRect, "Login", buttonStyle))
        {
            ClearFocus();
            loginAttempts++;
            ADAGEMenu.ShowPanel <ADAGESplashPanel>();
            ADAGE.LoginPlayer(username.Trim(), password.Trim());
        }
        GUI.enabled = true;

        if (!isLocked)
        {
            if (GUI.Button(backButtonRect, "Back", buttonStyle))
            {
                ClearFocus();
                ADAGEMenu.ShowLast();
            }
        }

        if (ADAGE.AllowFacebook)
        {
            if (GUI.Button(facebookButtonRect, "", imageButtonStyle))
            {
                ClearFocus();
            }
        }

        CheckFields();
    }
Ejemplo n.º 3
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            loading = false;
        }

        if (cameraTexture != null)
        {
            GUI.DrawTexture(imagePanelRect, cameraTexture, ScaleMode.StretchToFill);
        }

        GUI.Label(labelRect, "Point your camera at the QR code");

        if (!isLocked)
        {
            if (GUI.Button(backButtonRect, "Back", buttonStyle))
            {
                ADAGEMenu.ShowLast();
            }
        }
    }