|
@@ -260,7 +260,7 @@ public class Database : MonoBehaviour {
|
|
|
return this.questionTimer;
|
|
return this.questionTimer;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- internal void GetOnlineGames(int userId, GameObject prefab) {
|
|
|
|
|
|
|
+ internal List<OnlineGameScript> GetOnlineGames(int userId, GameObject prefab) {
|
|
|
|
|
|
|
|
WWWForm formData = new WWWForm();
|
|
WWWForm formData = new WWWForm();
|
|
|
formData.AddField("userId", userId);
|
|
formData.AddField("userId", userId);
|
|
@@ -274,12 +274,16 @@ public class Database : MonoBehaviour {
|
|
|
|
|
|
|
|
GameObject onlineGameObject;
|
|
GameObject onlineGameObject;
|
|
|
OnlineGameScript ogs = null;
|
|
OnlineGameScript ogs = null;
|
|
|
|
|
+ List<OnlineGameScript> games = new List<OnlineGameScript>();
|
|
|
foreach (OnlineGame game in og.onlineGamesList) {
|
|
foreach (OnlineGame game in og.onlineGamesList) {
|
|
|
onlineGameObject = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
|
|
onlineGameObject = Instantiate(prefab, new Vector2(0, 0), Quaternion.identity) as GameObject;
|
|
|
ogs = onlineGameObject.GetComponent<OnlineGameScript>();
|
|
ogs = onlineGameObject.GetComponent<OnlineGameScript>();
|
|
|
|
|
|
|
|
ogs.SetGameStatusText(game.status);
|
|
ogs.SetGameStatusText(game.status);
|
|
|
|
|
+ games.Add(ogs);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ return games;
|
|
|
//TODO Continue development here
|
|
//TODO Continue development here
|
|
|
}
|
|
}
|
|
|
|
|
|