예제 #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);
        }
예제 #2
0
        static void Main(string[] args)
        {
            var people = XmlDeserializer.Read <People>("People.xml");

            foreach (var person in people.PeopleList)
            {
                Console.WriteLine($"Age : {person.Age}\nName : {person.Name}");
            }
            Console.WriteLine("Enter any key");
            Console.ReadKey();
        }