public virtual void Load(IDataNode dataNode, IResourceManager resourceManager)
        {
            var shaderName = dataNode.ReadParameter("shader");

            _shader = resourceManager.GetShader(shaderName);
            _name   = dataNode.ReadParameter("key");
            var textureParameters = new Dictionary <string, string>();

            dataNode.ReadAllParameters(_vectorParameters, _numericParameters, textureParameters);
            foreach (var textureParameter in textureParameters)
            {
                if (resourceManager.HasTexture(textureParameter.Value))
                {
                    _textureParameters.Add(textureParameter.Key, resourceManager.GetTexture(textureParameter.Value));
                }
            }
        }
コード例 #2
0
ファイル: Material.cs プロジェクト: dgopena/Starter3D.Base
 public virtual void Load(IDataNode dataNode, IResourceManager resourceManager)
 {
   var shaderName = dataNode.ReadParameter("shader");
   _shader = resourceManager.GetShader(shaderName);
   _name = dataNode.ReadParameter("key");
   var textureParameters = new Dictionary<string, string>();
   dataNode.ReadAllParameters(_vectorParameters, _numericParameters, textureParameters);
   foreach (var textureParameter in textureParameters)
   {
     if(resourceManager.HasTexture(textureParameter.Value))
       _textureParameters.Add(textureParameter.Key, resourceManager.GetTexture(textureParameter.Value));
   }
 }