public EnemyInformation(string name) { EnemyXMLContainer enemies = EnemyStorage.Enemies; foreach (EnemyXML e in enemies.enemies) { if (name.Contains(e.name)) { Load(e); } } }
public static EnemyXMLContainer LoadEnemyInformation(string path) { TextAsset xml = Resources.Load <TextAsset>(path); XmlSerializer serializer = new XmlSerializer(typeof(EnemyXMLContainer)); StringReader reader = new StringReader(xml.text); EnemyXMLContainer enemies = serializer.Deserialize(reader) as EnemyXMLContainer; reader.Close(); return(enemies); }
void Awake() { EnemyStorage.Enemies = EnemyXMLContainer.LoadEnemyInformation(enemiesPath); }