Example #1
0
        AssetState GetAssetState(GleyAssets assetToCheck)
        {
            AssetState result = AssetState.InProject;

            if (!AssetDatabase.IsValidFolder("Assets/GleyPlugins/" + assetToCheck + "/Scripts"))
            {
                return(AssetState.NotDownloaded);
            }

            if (!File.Exists(Application.dataPath + "/GleyPlugins/" + assetToCheck + "/Scripts/Version.txt"))
            {
                nrOfUpdates++;
                return(AssetState.UpdateAvailable);
            }

            if (allAssetsVersion != null)
            {
                if (AssetNeedsUpdate(assetToCheck))
                {
                    nrOfUpdates++;
                    return(AssetState.UpdateAvailable);
                }
            }

            return(result);
        }
 public AssetStorePackage(GleyAssets asset, string name, string textureName, string description, string url)
 {
     this.asset       = asset;
     this.name        = name;
     this.description = description;
     this.url         = url;
     this.textureName = textureName;
 }
Example #3
0
        private bool AssetNeedsUpdate(GleyAssets assetToCheck)
        {
            string       path          = "Assets//GleyPlugins/" + assetToCheck + "/Scripts/Version.txt";
            StreamReader reader        = new StreamReader(path);
            int          localVersion  = JsonUtility.FromJson <AssetVersion>(reader.ReadToEnd()).shortVersion;
            int          serverVersion = allAssetsVersion.assetsVersion.First(cond => cond.assetName == assetToCheck).shortVersion;

            reader.Close();
            if (localVersion < serverVersion)
            {
                return(true);
            }
            return(false);
        }
 public AssetVersion(GleyAssets assetName)
 {
     this.assetName = assetName;
 }