Ejemplo n.º 1
0
        public static VersionInfo UpdateVersion(string versionSourcePath)
        {
            //Debug.Log("UpdateVersion "+versionSourcePath);
            string versionText = Utils.GetFileContents(versionSourcePath);

            if (versionText != null)
            {
                Hashtable _version = (Hashtable)JSON.JsonDecode(versionText);
                int       Major    = (int)_version["Major"];
                int       Minor    = (int)_version["Minor"];
                int       Patch    = (int)_version["Patch"];
                int       Build    = (int)_version["Build"];

                VersionInfo.VersionType Type = VersionInfo.GetVersionTypeFromString((string)_version["Type"]);

                                #if AUTHORING
                Build++;
                _version["Build"] = Build;
                Utils.PutFileContents(versionSourcePath, JSON.JsonEncode(_version));
                                #endif
                return(new VersionInfo(Major, Minor, Patch, Type, Build));
            }
            else
            {
                Debug.LogError("UpdateVersion Could not find " + versionSourcePath);
            }

            return(new VersionInfo());
        }