} public void Init() { XElement wc = WeaponContainer.Load(path); WeaponInfos = wc.Element("Weapons").Elements("Weapon").Select(c => new Weapon().Set(c)).ToDictionary(info => info.id); }
public Dictionary <int, Weapon> GetDict() { XElement wc = WeaponContainer.Load(path); WeaponInfos = wc.Element("Weapons").Elements("Weapon").Select(c => new Weapon().Set(c)).ToDictionary(info => info.id); return(WeaponInfos); }
void Awake() { collection = WeaponContainer.Load(Path.Combine(Application.dataPath, "weapons.xml")); weapons = collection.weapons; GiveWeapon(weapons[0]); }