コード例 #1
0
        public static void ImportMappings()
        {
            string path = EditorUtility.OpenFilePanel("Import Mappings", "", "txt");

            PersistentClassMapping[] classMappings     = null;
            PersistentClassMapping[] surrogateMappings = null;

            try
            {
                MappingsUtility.Import(path, out classMappings, out surrogateMappings);
                MappingsUtility.MergeClassMappings(classMappings);
                MappingsUtility.MergeSurrogateMappings(surrogateMappings);
            }
            finally
            {
                Cleanup(classMappings);
                Cleanup(surrogateMappings);
            }
        }
コード例 #2
0
        private static void CompleteImportMappings(string mappingsPath)
        {
            EditorPrefs.DeleteKey("RTSL_ImportMappings");

            PersistentClassMapping[] classMappings     = null;
            PersistentClassMapping[] surrogateMappings = null;

            try
            {
                MappingsUtility.Import(mappingsPath, out classMappings, out surrogateMappings);
                MappingsUtility.MergeClassMappings(classMappings);
                MappingsUtility.MergeSurrogateMappings(surrogateMappings);
            }
            finally
            {
                Cleanup(classMappings);
                Cleanup(surrogateMappings);
                File.Delete(mappingsPath);
                File.Delete(mappingsPath + ".meta");
            }

            EditorCoroutine.Start(CoBuildAll());
        }