Exemplo n.º 1
0
 void SetConfValue(string key, string value)
 {
     foreach (CTabFile.RowInterator row in ConfFile)
     {
         string key2 = row.GetString("Key");
         if (key == key2)
         {
             ConfFile.SetValue <string>(row.Row, "Value", value);
         }
     }
     ConfFile.Save(ConfFilePath);
     AssetDatabase.Refresh();
 }
    static void CheckConfigFile()
    {
        if (!File.Exists(ConfFilePath))
        {
            CTabFile confFile = new CTabFile();
            confFile.NewRow();
            confFile.NewColumn("Key");
            confFile.NewColumn("Value");
            confFile.NewColumn("Comment");


            foreach (string[] strArr in DefaultConfigFileContent)
            {
                int row = confFile.NewRow();
                confFile.SetValue<string>(row, "Key", strArr[0]);
                confFile.SetValue<string>(row, "Value", strArr[1]);
                confFile.SetValue<string>(row, "Comment", strArr[2]);
            }
            confFile.Save(ConfFilePath);

            CBase.Log("新建CosmosEngine配置文件: {0}", ConfFilePath);
            AssetDatabase.Refresh();
        }

        ConfFile = CTabFile.LoadFromFile(ConfFilePath);
    }
Exemplo n.º 3
0
        static void CheckConfigFile()
        {
            if (!File.Exists(ConfFilePath))
            {
                CTabFile confFile = new CTabFile();
                confFile.NewColumn("Key");
                confFile.NewColumn("Value");
                confFile.NewColumn("Comment");


                foreach (string[] strArr in DefaultConfigFileContent)
                {
                    int row = confFile.NewRow();
                    confFile.SetValue <string>(row, "Key", strArr[0]);
                    confFile.SetValue <string>(row, "Value", strArr[1]);
                    confFile.SetValue <string>(row, "Comment", strArr[2]);
                }
                confFile.Save(ConfFilePath);

                CDebug.Log("新建CosmosEngine配置文件: {0}", ConfFilePath);
                AssetDatabase.Refresh();
            }

            ConfFile = CTabFile.LoadFromFile(ConfFilePath);
        }
Exemplo n.º 4
0
    public static bool IsCheckMd5 = false;  // 跟AssetServer关联~如果true,函数才有效

    public static void WriteVersion()
    {
        string   path    = GetBuildVersionTab();// MakeSureExportPath(VerCtrlInfo.VerFile, EditorUserBuildSettings.activeBuildTarget);
        CTabFile tabFile = new CTabFile();

        tabFile.NewColumn("AssetPath");
        tabFile.NewColumn("AssetMD5");
        tabFile.NewColumn("AssetDateTime");
        tabFile.NewColumn("ChangeCount");

        foreach (var node in BuildVersion)
        {
            int row = tabFile.NewRow();
            tabFile.SetValue(row, "AssetPath", node.Key);
            tabFile.SetValue(row, "AssetMD5", node.Value.MD5);
            tabFile.SetValue(row, "AssetDateTime", node.Value.DateTime);
            tabFile.SetValue(row, "ChangeCount", node.Value.ChangeCount);
        }

        tabFile.Save(path);
    }