コード例 #1
0
 /// <summary>
 /// Loads a PGIModel from a given file path relative to the persistent data path
 /// and replaces this component's model with it.
 /// </summary>
 /// <param name="path"></param>
 public void LoadFromPersistentPath(string path)
 {
     if (!string.IsNullOrEmpty(Application.persistentDataPath + "/" + path))
     {
         XmlDocument doc = new XmlDocument();
         doc.InnerXml = File.ReadAllText(Application.persistentDataPath + "/" + path);
         PGIModel.LoadModel(doc.InnerXml, 1, ref Model);
     }
 }
コード例 #2
0
 /// <summary>
 /// Loads a PGIModel from a given file path and replaces this component's model with it.
 /// </summary>
 /// <param name="path"></param>
 public void Load(string path)
 {
     if (!string.IsNullOrEmpty(path))
     {
         XmlDocument doc = new XmlDocument();
         doc.InnerXml = File.ReadAllText(path);
         PGIModel.LoadModel(doc.InnerXml, 1, ref Model);
     }
 }