Advertisement
AndrewRosyaev

Dialog

May 14th, 2016
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Xml.Serialization;
  4. using System.IO;
  5.  
  6. [XmlRoot("dialogue")]
  7. public class Dialog
  8. {
  9.     [XmlElement("text")]
  10.     public string text;
  11.  
  12.     public static Dialog Load(TextAsset _xml)
  13.     {
  14.         XmlSerializer serializer = new XmlSerializer (typeof(Dialog));
  15.         StringReader reader = new StringReader (_xml.text);
  16.         Dialog dial = serializer.Deserialize (reader) as Dialog;
  17.         return dial;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement