void Callback(bool success, string response) { if (success) { // if you successfully receive the twitter info, // execute this area SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response); // statuses[0] returns the most recent tweet // anatomy of the JSON object that it returns Debug.Log(Response.statuses[0].text); Debug.Log(Response.statuses[0].user); Debug.Log(Response.statuses[0].created_at); // call a function from another script! GetComponent <GenText>().DropText(Response.statuses[0].text); } else { // if you dont successfully retrieve the info, execute this Debug.Log(response); } }
void OnGetSearchTweets(bool success, string response) { if (success) { SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response); foreach (Tweet tweet in Response.statuses) { _TweetPanelManager.GenerateTweetCardAtRandomPosition(tweet); } } else { _SystemMessageHandler.GenerateSystemMessage(response); } }
void Callback(bool success, string response) { if (success) { // if you successfully receive the twitter info, // execute this area SearchTweetsResponse Response = JsonUtility.FromJson <SearchTweetsResponse> (response); // statuses[0] returns the most recent tweet // anatomy of the JSON object that it returns Debug.Log(Response.statuses[0].text); Debug.Log(Response.statuses[0].user); Debug.Log(Response.statuses[0].created_at); Tweettext.text = Response.statuses [0].text; } else { // if you dont successfully retrieve the info, execute this Debug.Log(response); } }