Пример #1
0
    //-----------------------------------------------------------------------------------------------------------------
    // Opens given Facebook/Twitter site.
    //-----------------------------------------------------------------------------------------------------------------
    void VisitSite(SiteData site)
    {
        //	Debug.Log( "CAPA" );
        //	Debug.Log( "CAPA : GuiScreenBank : VisitSite( " + site.m_URL + " )" );

        m_LoggedIn     = true;
        m_WaitForLogin = 0.0f;
        m_VisitingSite = site;

        if (site.m_FBSite)         // Facebook
        {
            if ((site.m_Rewarded == false) && (FacebookPlugin.Instance.CurrentUser == null))
            {
                //	Debug.Log( "CAPA : GuiScreenBank : VisitSite : Login to Facebook..." );

                m_LoggedIn     = false;
                m_WaitForLogin = float.MaxValue;

                FacebookPlugin.Instance.Login("user_likes", OnFacebookLoginComplete);
            }
        }
        else         // Twitter
        {
            if ((site.m_Rewarded == false) && (TwitterWrapper.IsLoggedIn() == false))
            {
                //	Debug.Log( "CAPA : GuiScreenBank : VisitSite : Login to Twitter..." );

                m_LoggedIn     = false;
                m_WaitForLogin = float.MaxValue;

                TwitterUtils.LogIn(this.OnLoginResult);
            }
        }

        StartCoroutine(WaitForLogin());
    }