//============================================================ // <T>扫描工作路径,获得对象列表。</T> //============================================================ public override void Scan() { base.Scan(); // 设置目录 _exportFileName = _directoryExprot + "\\tx_" + Code + ".swf"; _exportFileDataName = _directoryExprot + ".dt\\tx_" + Code + ".swf"; // 查询图片 string resourceDirectory = RContent3dManager.TextureConsole.ResourceDirectory; foreach (string filename in RDirectory.ListFiles(_directory)) { FFileInfo info = new FFileInfo(filename); int typeCd = EDrTexture.TryParse(info.ShortName); if (-1 != typeCd) { FDrTextureBitmap bitmap = new FDrTextureBitmap(); bitmap.TypeCd = typeCd; bitmap.Source = info.FullName.Substring(resourceDirectory.Length); bitmap.FileName = info.FullName; bitmap.Length = info.Info.Length; _bitmaps.Push(bitmap); } } // 加载设置文件 if (RFile.Exists(_configFileName)) { LoadConfigFile(_configFileName); } }
//============================================================ // <T>加载配置信息。</T> // // @param xconfig 配置信息 //============================================================ public override void LoadConfig(FXmlNode xconfig) { foreach (FXmlNode xnode in xconfig.Nodes) { if (xnode.IsName("Bitmap")) { // 查找图片对象 string typeName = null; if (xnode.Contains("type")) { typeName = xnode.Get("type"); } else { typeName = xnode.Get("type_name"); } int typeCd = EDrTexture.Parse(typeName); FDrTextureBitmap bitmap = FindByTypeCd(typeCd); if (null != bitmap) { // 加载设置 bitmap.LoadConfig(xnode); } else { RMoCore.TrackConsole.Write(this, "LoadConfig", "Texture bitmap is not exists in config. (type_name={0}, file_name={1})", typeName, _configFileName); } } } }
//============================================================ // <T>加载设置信息。</T> // // @param xconfig 配置信息 //============================================================ public void LoadConfig(FXmlNode xconfig) { string typeName = null; // 读取类型 if (xconfig.Contains("type")) { typeName = xconfig.Get("type"); } else { typeName = xconfig.Get("type_name"); } _typeCd = EDrTexture.Parse(typeName); // 读取属性 _tick = xconfig.GetInteger("tick", _tick); }