コード例 #1
0
        public static void Init()
        {
            string filePath = Path.Combine("scripts", "ReloadingBenchData", "benches.xml");

            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException("benches.xml not found, make sure you have ReloadingBenchData inside scripts.");
            }

            XDocument doc = XDocument.Load(filePath);

            _data = doc.Descendants("Bench").ToDictionary(
                item => Guid.Parse(item.Attribute("id").Value),
                item => Bench.FromXElement(item)
                );
        }