Esempio n. 1
0
        public virtual void HandleAuthEvent(TweetMedia.AuthStateCode code)
        {
            switch (code)
            {
                case TweetMedia.AuthStateCode.VerifyCredentialsBegin:
                    status_text = "";
                    m_ui_auth.SetActive(false);
                    m_ui_tweet.SetActive(false);
                    break;
                case TweetMedia.AuthStateCode.VerifyCredentialsSucceeded:
                    m_ui_tweet.SetActive(true);
                    break;
                case TweetMedia.AuthStateCode.VerifyCredentialsFailed:
                    m_ui_auth.SetActive(true);
                    break;

                case TweetMedia.AuthStateCode.RequestAuthURLBegin:
                    m_input_pin.text = "";
                    m_button_auth_url.interactable = false;
                    m_input_pin.interactable = false;
                    m_button_pin.interactable = false;
                    break;
                case TweetMedia.AuthStateCode.RequestAuthURLSucceeded:
                    m_button_auth_url.interactable = true;
                    m_input_pin.interactable = true;
                    m_button_pin.interactable = true;
                    break;
                case TweetMedia.AuthStateCode.RequestAuthURLFailed:
                    status_text = m_tweet_media.error_message;
                    break;

                case TweetMedia.AuthStateCode.EnterPINBegin:
                    status_text = "";
                    break;
                case TweetMedia.AuthStateCode.EnterPINSucceeded:
                    m_ui_auth.SetActive(false);
                    m_ui_tweet.SetActive(true);
                    break;
                case TweetMedia.AuthStateCode.EnterPINFailed:
                    status_text = m_tweet_media.error_message;
                    break;
            }
        }
Esempio n. 2
0
 public virtual void HandleTweetEvent(TweetMedia.TweetStateCode code)
 {
     switch (code)
     {
         case TweetMedia.TweetStateCode.Begin:
             status_text = "Tweet in progress...";
             m_input_message.interactable = false;
             m_button_tweet.interactable = false;
             break;
         case TweetMedia.TweetStateCode.Succeeded:
             m_input_message.text = "";
             status_text = "Succeeded!";
             m_input_message.interactable = true;
             m_button_tweet.interactable = true;
             break;
         case TweetMedia.TweetStateCode.Failed:
             status_text = "Failed: " + m_tweet_media.error_message;
             m_input_message.interactable = true;
             m_button_tweet.interactable = true;
             break;
     }
 }
 void Start()
 {
     m_tweet_media = GetComponent <TweetMedia>();
     m_tweet_media.AddTweetEventHandler(AttachFile);
 }