コード例 #1
0
    private bool IsValid()
    {
        if (username.Trim() == "" || username == kDefaultUsernameText)
        {
            ADAGEMenu.ShowError(-1, "Username cannot be blank");
            return(false);
        }

        if (password.Trim() == "" || password == kDefaultPasswordText)
        {
            ADAGEMenu.ShowError(-1, "Password cannot be blank");
            return(false);
        }

        if (email.Trim() == "" || email == kDefaultEmailText)
        {
            ADAGEMenu.ShowError(-1, "Email cannot be blank");
            return(false);
        }

        if (password != confirm || confirm == kDefaultConfirmText)
        {
            ADAGEMenu.ShowError(-1, "Passwords do not match");
            return(false);
        }

        return(true);
    }
コード例 #2
0
    public override IEnumerator Update()
    {
        if (cameraTexture == null)
        {
                        #if UNITY_WEBPLAYER
            yield return(Application.RequestUserAuthorization(UserAuthorization.WebCam));

            if (Application.HasUserAuthorization(UserAuthorization.WebCam))
            {
                InitCamera();
                yield return(null);
            }
            else
            {
                ADAGEMenu.ShowPanel <ADAGELoginPanel>();
            }
                        #else
            InitCamera();
                        #endif
        }
        else
        {
            if (!cameraTexture.isPlaying)
            {
                cameraTexture.Play();
            }
            else
            {
                if (W != cameraTexture.width)
                {
                    W = cameraTexture.width;
                }
                if (H != cameraTexture.height)
                {
                    H = cameraTexture.height;
                }
            }
        }

        if (c == null)
        {
            c = cameraTexture.GetPixels32();
        }

        if (qrResult != "" && !decoding)
        {
            lastQrResult = qrResult;

            try
            {
                ADAGEQRGroup qrData = LitJson.JsonMapper.ToObject <ADAGEQRGroup>(qrResult);
                ADAGEMenu.ShowPanel <ADAGESplashPanel>();
                ADAGE.ConnectWithQR(qrData.group);
            }
            catch
            {
                if (ADAGEMenu.instance != null)
                {
                    ADAGEMenu.ShowError(-1, "Invalid QR Code");
                    StartThread();
                }
            }
            qrResult = "";
        }
        yield return(null);
    }