Beispiel #1
0
 public void fbAction()
 {
     soundButton();
     if (KuberaSyncManger.GetCastedInstance <KuberaSyncManger>().facebookProvider.isLoggedIn)
     {
         inviteFriendsText.text = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.AFTERGAME_POPUP_FACEBOOK);
         FacebookManager.GetInstance().requestNewFriends();
     }
     else
     {
         inviteFriendsText.text = MultiLanguageTextManager.instance.getTextByID(MultiLanguageTextManager.AFTERGAME_POPUP_CONNECT_FACEBOOK);
         KuberaSyncManger.GetCastedInstance <KuberaSyncManger>().facebookLogin();
     }
 }
Beispiel #2
0
 public void ConnectFB()
 {
     if (fbManager == null)
     {
         fbManager = FacebookManager.GetInstance();
     }
     if (fbManager == null)
     {
         return;
     }
     fbManager.FBLogin(isSuccess => {
         if (isSuccess)
         {
             UpdateFacebookUI();
         }
     });
 }
Beispiel #3
0
 void UpdateFacebookUI()
 {
     if (fbManager == null)
     {
         fbManager = FacebookManager.GetInstance();
     }
     if (fbManager == null)
     {
         return;
     }
     if (fbManager.IsFBConnected())
     {
         btnFBConnect.SetActive(false);
         btnFbConnectd.SetActive(true);
         fbDisplay.UpdateFacebookUI();
     }
     else
     {
         btnFBConnect.SetActive(true);
         btnFbConnectd.SetActive(false);
     }
 }
    public void UpdateFacebookUI()
    {
        if (fbManager == null)
        {
            fbManager = FacebookManager.GetInstance();
        }
        if (fbManager == null)
        {
            return;
        }
        Debug.Log("<color=green>UpdateFacebookUI </color>");
        if (fbManager.IsFBConnected())
        {
            fbManager.GetFacebookName(name => {
                txtFBName.text = name;
            });

            fbManager.GetAvatar(texture2D =>
            {
                avatar.sprite = Sprite.Create(texture2D, new Rect(0, 0, 128, 128), new Vector2(1f, 0.5f));
            });
        }
    }
 private void Start()
 {
     fbManager = FacebookManager.GetInstance();
 }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     soundManager = SoundManager.getInstance();
     fbManager    = FacebookManager.GetInstance();
     StartCoroutine(Init());
 }