using UnityEngine;
using System.Collections;
using UnityEngine.UI;
/*
* USAGE
*
* Just put this script into a button that needs
* to execute the HTTP request, and in the text field
* write the exact URL needed for the request.
* */
// http://corder.tech/mocha/users/*
public class GetLeaderboard : MonoBehaviour
{
public Button thisbutton;
public Text Usernames;
public Text Scores;
public string request = "http://corder.tech/mocha/users/*";
void Start()
thisbutton.onClick.AddListener (CallGetData);
}
public void CallGetData()
DisplayAllSeparated(request, Usernames, Scores);
public void DisplayAllSeparated(string request, Text Usernames, Text Scores)
MochaParser parser = new MochaParser ();
StartCoroutine (parser.DisplayOutputSeparated(request, Usernames, Scores));