Exemple #1
0
 /// <summary>
 /// Initializes a RenderWare material instance with default properties.
 /// </summary>
 public RWMaterial(RWNode parent = null)
     : base(RWNodeType.Material, parent)
 {
     _struct = new RWMaterialStruct(this);
     _struct.IsTextured = false;
     _textureReference = null;
     _extension = new RWExtension(this);
 }
Exemple #2
0
        /// <summary>
        /// Initializes a RenderWare material using data from the <see cref="RWNodeFactory"/>.
        /// </summary>
        /// <param name="header"></param>
        /// <param name="reader"></param>
        internal RWMaterial(RWNodeFactory.RWNodeInfo header, BinaryReader reader)
            : base(header)
        {
            _struct = RWNodeFactory.GetNode<RWMaterialStruct>(this, reader);

            if (_struct.IsTextured)
                _textureReference = RWNodeFactory.GetNode<RWTextureReference>(this, reader);

            _extension = RWNodeFactory.GetNode<RWExtension>(this, reader);
        }