Exemple #1
0
        public static bool Prefix(ResourceManager __instance)
        {
            __instance.levelPrefabFileInfosRoot_ = new LevelPrefabFileInfo("Default", null);

            DirectoryInfo CustomObjects = new DirectoryInfo(Resource.PersonalCustomObjectsDirPath_);

            if (CustomObjects.Exists)
            {
                __instance.customObjectFileInfosRoot_ = new LevelPrefabFileInfo("Custom", __instance.levelPrefabFileInfosRoot_);
                __instance.levelPrefabFileInfosRoot_.AddChildInfo(__instance.customObjectFileInfosRoot_);

                AddSubfoldersRecursive(CustomObjects, __instance.customObjectFileInfosRoot_);
            }

            string          path            = Application.dataPath + "/Resources/LevelEditorPrefabDirectoryInfo.xml";
            XmlDeserializer xmlDeserializer = new XmlDeserializer(path);

            while (xmlDeserializer.Read("LevelEditorPrefabDirectoryInformation"))
            {
                __instance.ReadFileDataRecursive(xmlDeserializer, __instance.levelPrefabFileInfosRoot_);
            }

            xmlDeserializer?.Finish();

            return(false);
        }