Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Documento XML
- <?xml version="1.0" encoding="utf-8"?>
- <languages>
- <English>
- <iniciar>Start</iniciar>
- <app_name>Game Dogs</app_name>
- <Descricao>Testing</Descricao>
- <Teste>Teste1</Teste>
- </English>
- <Portugues>
- <iniciar>Iniciar</iniciar>
- <app_name>Jogo Cachorros</app_name>
- <Descricao>Teste</Descricao>
- <Teste>Teste2</Teste>
- </Portugues>
- <Espanhol>
- <iniciar>Arriba</iniciar>
- <app_name>EL doguitos</app_name>
- <Descricao>El joguito mucho loko</Descricao>
- <Teste>Teste3</Teste>
- </Espanhol>
- </languages>
- ---------------------------------------------------------------------------------------------
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- using System.Xml;
- public class Languages : MonoBehaviour {
- public static XmlNodeList Linguagens;
- void Awake()
- {
- //Carrega o arquivo .Xml contendo as linguagens
- TextAsset xmlFile = (TextAsset)Resources.Load("linguagens");
- //Instancia um novo documento para guardar os dados do .Xml
- XmlDocument xmlDocument = new XmlDocument();
- //Preenche o novo com os dados armazenados no .Xml carregado
- xmlDocument.LoadXml(xmlFile.text);
- Linguagens = xmlDocument.GetElementsByTagName("Espanhol");
- print(Linguagens[0].SelectSingleNode("Descricao").InnerXml);
- }
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement