예제 #1
0
        //============================================================
        // <T>加载配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        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);
            _source = xconfig.Nvl("source").Replace('/', '\\');
            string sourceTypeName = xconfig.Nvl("source_type");

            _sourceTypeCd = EDrTexture.Parse(typeName);
            _sourceIndex  = xconfig.GetInteger("source_index", _sourceIndex);
            // 获得关联纹理
            _texture = RContent3dManager.TextureConsole.Find(Source);
            if (null == _texture)
            {
                _texture = RContent3dManager.TextureConsole.Find(Source);
                RMoCore.TrackConsole.Write(this, "LoadConfig", "Texture source is not exists. (material={0}, texture={1})",
                                           _material.Code, SourceCode);
                return;
            }
            _textureBitmap = _texture.FindByTypeCd(_sourceTypeCd, _sourceIndex);
        }
예제 #2
0
        //============================================================
        // <T>加载配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        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);
            _source     = xconfig.Nvl("source");
            _source     = _source.Replace('/', '\\');
            _sourceType = xconfig.Nvl("source_type");
        }