private void bunifuFlatButton2_Click(object sender, EventArgs e)
 {
     SignUpPanel.Show();
     SignInPanel.Hide();
     SignInselected.Hide();
     SignUpselected.Show();
 }
Beispiel #2
0
        // Providers Login Btn

        public void CustomizeProvidersLoginBtnRectTransform <T>(T value, CustomizerDelegate <RectTransform, T> customizerDelegate)
        {
            SignInPanel  signinPanel  = m_MainController.GetComponentInChildren <SignInPanel>();
            AccountPanel accountPanel = m_MainController.GetComponentInChildren <AccountPanel>();

            // buttons in signin panel (email and anonymous sign in)
            foreach (GameObject obj in signinPanel.genericProviderButtonsList)
            {
                CustomizeComponent(obj.GetComponent <RectTransform>(), value, customizerDelegate);
            }

            // providers button
            foreach (var provider in PlayerIdentityManager.Current.loginProviders)
            {
                CustomizeComponent(provider.GetButton().GetComponent <RectTransform>(), value, customizerDelegate);
            }

            // we only customize all the prefabs and not the instantiated providers button
            // we dont need this call only on playmode since the providers button are only instantiated during runtime
            if (EditorApplication.isPlaying)
            {
                signinPanel.ReBuildProvidersList();
                accountPanel.UpdatePanel();
            }
        }
Beispiel #3
0
    public void MoveToSignIn()
    {
        PanelOff();
        SignInPanel signInPanel = Panels.instance.signInPanel;

        signInPanel.gameObject.SetActive(true);
        signInPanel.OnPanel(exPanel);
        exPanel.gameObject.SetActive(false);
    }
Beispiel #4
0
    public void SignIn()
    {
        HGL_WindowManager.I.CloseWindow(null, null, "WelcomePanel", false);

        SignInPanel signInPanel = HGL_WindowManager.I.GetWindow("SignInPanel").GetComponent <SignInPanel>();

        signInPanel.OnFormFilled += SignInPanel_OnFormFilled;
        HGL_WindowManager.I.OpenWindow(null, null, "SignInPanel", false, true);
    }
Beispiel #5
0
    private void OnConnected(HubConnection obj)
    {
        Debug.Log("connected to server");


        SignInPanel.DestroyModule();

        LangSelector.DestroyModule();

        Destroy(FindObjectOfType <TestClientStart>()?.gameObject);
    }
Beispiel #6
0
    public async UniTaskVoid Start()
    {
        await InitModules();

        SignInPanel.Create().Forget();
        LangSelector.Create();

#if GMS
        FB.Init(OnInitComplete);
#endif

#if HMS
        AdPlaceholder.SetActive(!HMSAdsKitManager.Instance.IsBannerAdLoaded);
        HMSAdsKitManager.Instance.OnBannerLoadEvent += () => AdPlaceholder.SetActive(false);
#endif

#if UNITY_WEBGL
        if (JsManager.IsFigSdkInit() == 0)
        {
            Debug.Log("seems like you're in the demo not fig");
            //TestClientStart.Create();
            return;
        }

        Debug.Log("user data: " + JsManager.GetUserData());
        var fbigUserData = JsonUtility.FromJson <FbigUserData>(JsManager.GetUserData());
        Debug.Log("user data loaeds: " + JsonUtility.ToJson(fbigUserData));

        if (fbigUserData.EnteredBefore == 0)
        {
            ConnectToServer(fbigToken: fbigUserData.Token, fbigUserData.Name, fbigUserData.PictureUrl);
        }
        else
        {
            ConnectToServer(fbigToken: fbigUserData.Token);
        }

        Repository.I.TopFriends = JsonUtility.FromJson <List <FbigFriend> >(JsManager.GetFriends())
                                  .Select(f => new MinUserInfo {
            Id = f.Id, Name = f.Name, PictureUrl = f.PictureUrl
        })
                                  .ToArray();

        Debug.Log("friends are: " + JsManager.GetFriends());
        Debug.Log("friends loaded: " + JsonUtility.ToJson(Repository.I.TopFriends));

        JsManager.StartFbigGame();
        //you can think it would make more sence to start when conntected, but there could be network issue and require reconnect for example
        //the decision is not final anyway
#endif
    }
Beispiel #7
0
    private void OnInitComplete()
    {
        Debug.Log(
            $"OnInitCompleteCalled IsLoggedIn={FB.IsLoggedIn} IsInitialized={FB.IsInitialized}" +
            $" and the AccessToken.CurrentAccessToken is {AccessToken.CurrentAccessToken}");

        if (FB.IsLoggedIn)
        {
            ConnectToServer(facebookAccToken: AccessToken.CurrentAccessToken.TokenString);
        }
        else
        {
            SignInPanel.Create().Forget();
        }
    }
Beispiel #8
0
 private void SignIn()
 {
     if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.B, PlayerID.One))
     {
         state = Enums.UIStates.Splash;
         UpdatePanels(SplashPanel);
     }
     if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.Start, PlayerID.One))
     {
         string text = SignInPanel.FindChild("NameCreator").FindChild("LetterHolder").GetComponent <NameCreator>().t.text;
         if (text.Length == 4)
         {
             ProfileData pd = new ProfileData(text);
             ProfileManager.instance.AddProfile(pd);
             SignInToMain();
         }
     }
 }
Beispiel #9
0
 private void SignIn()
 {
     if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.B, PlayerID.One))
     {
         SignInPanel.FindChild("NameCreator").FindChild("LetterHolder").GetComponent <NameCreator>().Reset();
         state = Enums.UIStates.Splash;
         UpdatePanels(SplashPanel);
         SFXManager.instance.PlayNegative();
         ControllerManager.instance.AllowPlayerRemoval(ControllerInputWrapper.Buttons.B);
     }
     if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.Start, PlayerID.One))
     {
         NameCreator nameCreator = SignInPanel.FindChild("NameCreator").FindChild("LetterHolder").GetComponent <NameCreator>();
         string      text        = nameCreator.t.text;
         if (text.Length > 0 && text.ToCharArray()[text.Length - 1] != ' ')
         {
             nameCreator.Reset();
             ProfileData pd = new ProfileData(text);
             ProfileManager.instance.AddProfile(pd);
             SignInToMain();
             SFXManager.instance.PlayAffirm();
         }
     }
 }
Beispiel #10
0
 /// <summary>
 /// Connects to the server
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void connectButton_Click(object sender, EventArgs e)
 {
     SignInPanel.Hide();
     NetworkingCode.Connect_to_Server(First_Contact_Callback, Server_Name.Text);
 }
Beispiel #11
0
 private void SignInButton_Click(object sender, EventArgs e)
 {
     SignInPanel.BringToFront();
     SignUpUnderlinePanel.BackColor = SignInPanel.BackColor;
     SignInUnderlinePanel.BackColor = Color.White;
 }
Beispiel #12
0
 private void LoginForm_Load(object sender, EventArgs e)
 {
     SignInPanel.BringToFront();
     SignUpUnderlinePanel.BackColor = SignInPanel.BackColor;
     SignInUnderlinePanel.BackColor = Color.White;
 }
Beispiel #13
0
    private void SignInPanel_OnFormFilled(string nickname, string password)
    {
        SignInPanel signInPanel = HGL_WindowManager.I.GetWindow("SignInPanel").GetComponent <SignInPanel>();

        signInPanel.StartCoroutine(TryLogin(nickname, password));
    }