Exemple #1
0
        public AssetParser(CrpReader reader)
        {
            this.reader = reader;

            this.parsers["ColossalFramework.Importers.Image"] = ImgParser.parseImage;
            this.parsers["UnityEngine.Mesh"]      = MeshParser.parseMesh;
            this.parsers["UnityEngine.Texture2D"] = ImgParser.parseImage;
            this.parsers["BuildingInfoGen"]       = InfoGenParser.parseInfoGen;
            this.parsers["PropInfoGen"]           = InfoGenParser.parseInfoGen;
            this.parsers["TreeInfoGen"]           = InfoGenParser.parseInfoGen;
            this.parsers["VehicleInfoGen"]        = InfoGenParser.parseInfoGen;
            this.parsers["CustomAssetMetaData"]   = InfoGenParser.parseInfoGen;
            this.parsers["UnityEngine.Material"]  = MaterialParser.parseMaterial;

            this.parsers["UnityEngine.GameObject"] = GameObjectParser.parseGameObj;
        }
 /// <summary>
 /// Initializes the object by opening the specified CRP file. Note and be prepared to handle the exceptions
 /// that may be thrown.
 /// </summary>
 /// <param name="filePath">Path to the CRP file that needs to be opened.</param>
 /// <exception cref="System.IO.IOException">Thrown if i.e the filePath parameter is incorrect, file is missing,
 /// in use, etc.</exception>
 public CrpDeserializer(string filePath)
 {
     stream      = File.Open(filePath, FileMode.Open);
     reader      = new CrpReader(stream);
     assetParser = new AssetParser(reader);
 }
 public CrpDeserializer(string filePath)
 {
     stream = File.Open(filePath, FileMode.Open);
     reader = new CrpReader(stream);
     assetParser = new AssetParser(reader);
 }