コード例 #1
0
    private IEnumerator Continue(VOGController ctrl)
    {
        try
        {
            ctrl.DisableInput();

            //wait for connection
            while (!VostopiaClient.HasSessionKey)
            {
                yield return null;
            }

            //See if user exists
            ApiCall call = VostopiaClient.Authentication.BeginFindUser(Email);
            IEnumerator e = call.Wait();
            while (e.MoveNext()) { yield return e.Current; }
            VostopiaUser user = VostopiaClient.Authentication.EndFindUser(call);

            if (user != null)
            {
                var passwordData = new VOGStateAuthPassword.PasswordData();
                passwordData.CancelOnBack = false;
                passwordData.User = user;
                ctrl.StartTransition(PasswordState, passwordData);
            }
            else
            {
                if (!ValidateEmail(Email))
                {
                    ctrl.ShowMessageDialog("Oops!", "Please enter a valid email address.", () => { });
                    yield break;
                }
                else
                {
                    ctrl.StartTransition(NewUserState, Email);
                }
            }

        }
        finally
        {
            ctrl.EnableInput();
        }
    }
コード例 #2
0
    public override void OnDrawGui(VOGController ctrl)
    {
        BeginWindow();

        //Header
        Heading("Hi and welcome!");
        Body("This game uses Vostopia avatars!\nThey exist across multiple games and apps, and you can use the same avatar everywhere that uses the Vostopia system.\n\nIn order to find your avatar, we need a way to remember you by:");

        //Ok button
        SetDefaultControl();
        SetDefaultButton();
        if (Button("Cool, let's do this", ctrl.InputEnabled(this)))
        {
            ctrl.StartTransition(EmailState);
        }

        //Cancel button
        SetBackButton();
        if (CurrentAuthSelectData.EnableCancel)
        {
            if (BackButton("Cancel", ctrl.InputEnabled(this)))
            {
                OnCancel(ctrl as VOGControllerAuth);
            }
        }
        else
        {
            if (BackButton("I don't wish to be remembered!", ctrl.InputEnabled(this)))
            {
                StartCoroutine(OnSignInGuest(ctrl as VOGControllerAuth));
            }
        }

        //Footer logo
        GUILayout.FlexibleSpace();
        GUILayout.Label(ctrl.GetTexture(VostopiaLogo), GUI.skin.FindStyle("image"), GUILayout.ExpandWidth(true));
        EndWindow();
    }
コード例 #3
0
 public void OnAnotherUser(VOGController ctrl)
 {
     var authSelectData = new VOGStateAuthSelect.AuthSelectData();
     authSelectData.EnableCancel = false;
     ctrl.StartTransition(AuthSelectorScreen, authSelectData);
 }