Exemple #1
0
 public void GetSegments()
 {
     ShowLoader();
     PlayFabAdminAPI.GetAllSegments(new GetAllSegmentsRequest(),
                                    result => {
         Debug.Log("GOT ALL SEGMENTS OK: " + result.ToJson().ToString());
         foreach (var segment in result.Segments)
         {
             GameObject newSegmentButton = Instantiate(segmentButton, Vector3.zero, Quaternion.identity, segmentButton.transform.parent) as GameObject;
             SegmentID identity          = newSegmentButton.GetComponent <SegmentID>();
             identity.segmentID          = segment.Id;
             identity.nameText.text      = segment.Name;
             newSegmentButton.SetActive(true);
         }
         segmentWindow.SetActive(true);
         HideLoader();
     },
                                    error => {
         HideLoader();
         Debug.LogError("ERROR GETTING SEGMENTS: " + error.GenerateErrorReport());
         Inform(error.ErrorMessage);
     });
 }