// Update is called once per frame
    //void Update()
    //{
    //    if (Input.GetKeyDown(KeyCode.P))
    //    {
    //        Screen.fullScreen = !Screen.fullScreen;
    //    }
    //}

    /// <summary>
    /// 获取系统设置
    /// </summary>
    public static void GetSystemSetting()
    {
        string path = Application.dataPath + ConfigPath;

        if (!File.Exists(path))
        {
            CreateSystemSettingXml();
        }
        else
        {
            systemSetting = SerializeHelper.DeserializeFromFile <SystemSetting>(path);
        }
        Log.Error("SystemSettingHelper.GetSystemSetting" + systemSetting.IsShowLeftTopo);
        resolutionSetting    = systemSetting.ResolutionSetting;
        cinemachineSetting   = systemSetting.CinemachineSetting;
        communicationSetting = systemSetting.CommunicationSetting;
        versionSetting       = systemSetting.VersionSetting;
        refreshSetting       = systemSetting.RefreshSetting;
        assetLoadSetting     = systemSetting.AssetLoadSetting;
        honeyWellSetting     = systemSetting.HoneyWellSetting;
        deviceSetting        = systemSetting.DeviceSetting;
        historyPathSetting   = systemSetting.HistoryPathSetting;
        alarmSetting         = systemSetting.AlarmSetting;
        ///如果版本号不一致,自动更新
        if (versionSetting.VersionNumber != SystemSettingHelper.instance.versionNum)
        {
            versionSetting.VersionNumber = SystemSettingHelper.instance.versionNum;
            SaveSystemSetting();
        }

        locationSetting = systemSetting.LocationSetting;

        debugSetting = systemSetting.DebugSetting;
    }
    public static VersionSetting Read(string path)
    {
        if (!File.Exists(path))
        {
            return(new VersionSetting());
        }

        string jsonStr = File.ReadAllText(path);

        VersionSetting result = JsonHelper.FromJson <VersionSetting>(jsonStr);

        return(result);
    }
示例#3
0
 public SystemSetting()
 {
     ResolutionSetting    = new ResolutionSetting();
     CinemachineSetting   = new CinemachineSetting();
     CommunicationSetting = new CommunicationSetting();
     VersionSetting       = new VersionSetting();
     RefreshSetting       = new RefreshSetting();
     AssetLoadSetting     = new AssetLoadSetting();
     HoneyWellSetting     = new HoneyWellSetting();
     DeviceSetting        = new DeviceSetting();
     HistoryPathSetting   = new HistoryPathSetting();
     LocationSetting      = new LocationSetting();
     DebugSetting         = new DebugSetting();
     AlarmSetting         = new AlarmSetting();
 }
示例#4
0
        public ActionResult Version(VersionSettingModel model)
        {
            VersionSetting entity = new VersionSetting();

            WebTools.CopyProperties(model, entity);
            entity.Mandatory = model.MandatoryStr == "on";
            _settingService.SaveSetting(entity, v => v.VersionCode, false);
            _settingService.SaveSetting(entity, v => v.VersionName, false);
            _settingService.SaveSetting(entity, v => v.UpdateTime, false);
            _settingService.SaveSetting(entity, v => v.IosDownloadUrl, false);
            _settingService.SaveSetting(entity, v => v.Mandatory, false);
            _settingService.SaveSetting(entity, v => v.DownloadUrl, false);
            _settingService.SaveSetting(entity, v => v.Description, false);
            _settingService.ClearCache();
            return(Ok());
        }
    public void Run()
    {
        versionSetting = VersionSetting.Read();
        currentVerData.version.CopyValue(versionSetting.lastVersion);
        compareVersionData.version.CopyValue(versionSetting.compareVersion);
        if (versionSetting.isAutoAdd)
        {
            currentVerData.version.Add();
        }

        readCompareVersionData();

        generateAll();
        generatePatch();


        versionSetting.lastVersion.CopyValue(currentVerData.version);
        if (versionSetting.isAutoAdd && versionSetting.isSetLastToNextCompera)
        {
            versionSetting.compareVersion.CopyValue(currentVerData.version);
        }
        versionSetting.Save();

        if (versionSetting.isDeleteVerFolderAll)
        {
            Directory.Delete(currentVerData.ver_all, true);
            Console.WriteLine("开始 删除目录 :" + currentVerData.ver_all);
        }


        if (versionSetting.isDeleteVerFolderPatch)
        {
            Directory.Delete(currentVerData.ver_patch, true);
            Console.WriteLine("开始 删除目录 :" + currentVerData.ver_patch);
        }
    }
示例#6
0
    public void Run()
    {
        versionSetting = VersionSetting.Read();
        currentVerData.version.CopyValue(versionSetting.lastVersion);
        compareVersionData.version.CopyValue(versionSetting.compareVersion);

        string preVerStr = versionSetting.lastVersion.ToString();

        if (versionSetting.isAutoAdd)
        {
            currentVerData.version.Add();
        }

        readCompareVersionData();


        currentVerData.manifest.Add("__ResVersion__", currentVerData.version.ToString());

        generateAll();
        generatePatch();


        versionSetting.lastVersion.CopyValue(currentVerData.version);
        if (versionSetting.isAutoAdd && versionSetting.isSetLastToNextCompera)
        {
            versionSetting.compareVersion.CopyValue(currentVerData.version);
        }
        versionSetting.Save();

        foreach (string path in versionSetting.replaceVersionTextFiles)
        {
            string verStr = currentVerData.version.ToString();

            if (File.Exists(path))
            {
                string content = File.ReadAllText(path);
                content = content.Replace(versionSetting.replaceVersionText, verStr);
                content = content.Replace(preVerStr, verStr);
                File.WriteAllText(path, content);
            }
        }


        foreach (string path in versionSetting.replaceVersionTextDelayFiles)
        {
            string verStr = currentVerData.version.ToString();

            if (versionSetting.isAutoAdd)
            {
                currentVerData.version.Add();
            }
            string nextVerStr = currentVerData.version.ToString();


            if (File.Exists(path))
            {
                string content = File.ReadAllText(path);
                content = content.Replace(versionSetting.replaceVersionDelayText, nextVerStr);
                content = content.Replace(verStr, nextVerStr);
                File.WriteAllText(path, content);
            }
        }
    }
示例#7
0
 private static void ParseVersionSetting()
 {
     verSetting = new VersionSetting();
     verSetting.LoadSettings();
 }