Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using LitJson;
- public class GameManger : MonoBehaviour {
- private JsonData questionData;
- bool foundQuestions;
- WWW myWWW;
- // Use this for initialization
- void Start() {
- myWWW = new WWW("https://opentdb.com/api.php?amount=30&category=15&difficulty=medium&type=multiple");
- foundQuestions = false;
- questionData = JsonMapper.ToObject(myWWW.text);
- }
- // Update is called once per frame
- void Update() {
- //if (myWWW.isDone && !foundQuestions) {
- // Debug.Log(myWWW.text);
- // foundQuestions = true;
- //}
- Debug.Log(questionData);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement