コード例 #1
0
    public EnemyInformation(string name)
    {
        EnemyXMLContainer enemies = EnemyStorage.Enemies;

        foreach (EnemyXML e in enemies.enemies)
        {
            if (name.Contains(e.name))
            {
                Load(e);
            }
        }
    }
コード例 #2
0
    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);
    }
コード例 #3
0
ファイル: Loader.cs プロジェクト: Fluqz/MindOverMatter
 void Awake()
 {
     EnemyStorage.Enemies = EnemyXMLContainer.LoadEnemyInformation(enemiesPath);
 }