using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GetDataManager : MonoBehaviour
{
	public Text objectText;
	public Text username;
	public Text score;

	public bool displayseparated = true;

	public string request = "http://corder.tech/mocha/users/5";

	void Start()
	{
		if (displayseparated)
		{
			CallGetDataSeparated ();
		}
		else
		{
			CallGetData ();
		}
	}

	public void CallGetData()
	{
		DisplayAll(request, objectText);
	}

	public void DisplayAll(string request, Text objectText)
	{
		MochaParser parser = new MochaParser();
		StartCoroutine (parser.DisplayOutput(request, objectText));
	}

	public void CallGetDataSeparated()
	{
		DisplayAllSeparated(request, username, score);
	}

	public void DisplayAllSeparated(string request, Text u, Text s)
	{
		MochaParser parser = new MochaParser();
		StartCoroutine (parser.DisplayOutputSeparated(false, request, u, s));
	}
}
