Пример #1
0
 void OnMissionStart(int missionID)
 {
     if (Data.Instance.isAndroid)
     {
         int videoGameID = Data.Instance.videogamesData.actualID;
         HiscoresByMissions.MissionHiscoreUserData hiscoreData = UserData.Instance.hiscoresByMissions.GetHiscore(videoGameID, missionID);
         if (hiscoreData == null)
         {
             print("no hay hiscore de videoGameID: " + videoGameID + " mission " + missionID);
             hiscorePanel.gameObject.SetActive(false);
         }
         else
         {
             hiscorePanel.Init(0, hiscoreData.username, hiscoreData.score);
             hiscorePanel.SetImage(hiscoreData.userID);
         }
     }
 }
    public void OnDone(HiscoresByMissions.MissionHiscoreData data)
    {
        int id = 0;

        if (data == null || data.all.Count == 0)
        {
            return;
        }
        foreach (HiscoresByMissions.MissionHiscoreUserData m in data.all)
        {
            ScoreLine newLine = Instantiate(scoreLine);
            newLine.transform.SetParent(container);
            newLine.transform.localPosition = Vector3.zero;
            newLine.transform.localScale    = Vector3.one;
            newLine.Init(id + 1, m.username, m.score);
            newLine.SetImage(m.userID);
            if (m.userID == UserData.Instance.userID)
            {
                MyScoreLoaded(m.score);
            }
            id++;
        }
    }