예제 #1
0
        private void CreateHotfixAssemblyDefinition(string filePath)
        {
            JsonData json = new JsonData();

            json["name"]             = "Hotfix";
            json["includePlatforms"] = new JsonData();
            json["includePlatforms"].Add("Editor");
            json["references"] = new JsonData();
            json["references"].Add("HTFramework.RunTime");

            File.WriteAllText(filePath, GlobalTools.JsonToString(json));
            AssetDatabase.Refresh();
            AssemblyDefinitionImporter importer = AssetImporter.GetAtPath("Assets" + _hotfixAssemblyDefinitionPath) as AssemblyDefinitionImporter;

            importer.SaveAndReimport();
        }
예제 #2
0
        private void SetHotfixAssemblyDefinition(string filePath)
        {
            string   contentOld = File.ReadAllText(filePath);
            JsonData json       = GlobalTools.StringToJson(contentOld);

            json["name"]             = "Hotfix";
            json["includePlatforms"] = new JsonData();
            json["includePlatforms"].Add("Editor");
            json["references"] = new JsonData();
            json["references"].Add("HTFramework.RunTime");
            string contentNew = GlobalTools.JsonToString(json);

            if (contentOld != contentNew)
            {
                File.WriteAllText(filePath, contentNew);
                AssetDatabase.Refresh();
                AssemblyDefinitionImporter importer = AssetImporter.GetAtPath("Assets" + _hotfixAssemblyDefinitionPath) as AssemblyDefinitionImporter;
                importer.SaveAndReimport();
            }
        }