Esempio n. 1
0
 public void UpdatePackages(object sender, EventArgs eventArgs)
 {
     PackageTiles.Clear();
     foreach (Transform t in PackagesDynamicContent.transform)
     {
         Destroy(t.gameObject);
     }
     foreach (IO.Swagger.Model.PackageSummary package in Base.GameManager.Instance.Packages)
     {
         PackageTile tile    = Instantiate(PackageTilePrefab, PackagesDynamicContent.transform).GetComponent <PackageTile>();
         bool        starred = PlayerPrefsHelper.LoadBool("package/" + package.Id + "/starred", false);
         string      projectName;
         try {
             projectName = GameManager.Instance.GetProjectName(package.ProjectId);
         } catch (ItemNotFoundException _) {
             projectName = "unknown";
         }
         tile.InitTile(package.PackageMeta.Name,
                       async() => await Base.GameManager.Instance.RunPackage(package.Id),
                       () => PackageOptionMenu.Open(tile),
                       starred,
                       package.Modified,
                       package.Modified,
                       package.Id,
                       projectName,
                       package.PackageMeta.Built.ToString());
         PackageTiles.Add(tile);
     }
     SortCurrentList();
 }
Esempio n. 2
0
 public void UpdatePackages(object sender, EventArgs eventArgs)
 {
     PackageTiles.Clear();
     foreach (Transform t in PackagesDynamicContent.transform)
     {
         if (t.gameObject.tag != "Persistent")
         {
             Destroy(t.gameObject);
         }
     }
     foreach (IO.Swagger.Model.PackageSummary package in Base.GameManager.Instance.Packages)
     {
         PackageTile tile    = Instantiate(PackageTilePrefab, PackagesDynamicContent.transform).GetComponent <PackageTile>();
         bool        starred = PlayerPrefsHelper.LoadBool("package/" + package.Id + "/starred", false);
         string      projectName;
         if (package.ProjectMeta == null || package.ProjectMeta.Name == null)
         {
             projectName = "unknown";
         }
         else
         {
             projectName = package.ProjectMeta.Name;
         }
         tile.InitTile(package.PackageMeta.Name,
                       async() => await Base.GameManager.Instance.RunPackage(package.Id),
                       () => PackageOptionMenu.Open(tile),
                       starred,
                       package.PackageMeta.Built,
                       package.PackageMeta.Executed,
                       package.Id,
                       projectName,
                       package.PackageMeta.Built.ToString());
         PackageTiles.Add(tile);
     }
     SortCurrentList();
     GameManager.Instance.HideLoadingScreen();
 }
Esempio n. 3
0
 public void Open(PackageTile packageTile)
 {
     this.packageTile = packageTile;
     Open((Tile)packageTile);
 }