TriLib Exporter
Search Results for

    Show / Hide Table of Contents

    Class Material

    Represents a Unity Material object, including its properties such as colors, floats, textures, and vectors, tailored for export.

    Inheritance
    object
    ObjectBase
    Material
    Inherited Members
    ObjectBase.Name
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: TriLibExporter.Objects
    Assembly: Assembly-CSharp.dll
    Syntax
    public class Material : ObjectBase

    Constructors

    Material(AssetWriterContext, Material)

    Initializes a new instance of the Material class.

    Declaration
    public Material(AssetWriterContext assetWriterContext, Material material)
    Parameters
    Type Name Description
    AssetWriterContext assetWriterContext

    The asset writer context associated with this material.

    Material material

    The Unity Material to represent.

    Properties

    Colors

    A dictionary storing the color properties of the material.

    Declaration
    public Dictionary<GenericMaterialProperty, Color> Colors { get; }
    Property Value
    Type Description
    Dictionary<GenericMaterialProperty, Color>

    Floats

    A dictionary storing the float properties of the material.

    Declaration
    public Dictionary<GenericMaterialProperty, float> Floats { get; }
    Property Value
    Type Description
    Dictionary<GenericMaterialProperty, float>

    ShaderName

    The original Unity material shader name.

    Declaration
    public string ShaderName { get; }
    Property Value
    Type Description
    string

    Textures

    A dictionary storing the texture properties of the material.

    Declaration
    public Dictionary<GenericMaterialProperty, Texture> Textures { get; }
    Property Value
    Type Description
    Dictionary<GenericMaterialProperty, Texture>

    Vectors

    A dictionary storing the vector properties of the material.

    Declaration
    public Dictionary<GenericMaterialProperty, Vector4> Vectors { get; }
    Property Value
    Type Description
    Dictionary<GenericMaterialProperty, Vector4>

    Methods

    GetColor(GenericMaterialProperty)

    Retrieves a color property from the material.

    Declaration
    public Color GetColor(GenericMaterialProperty genericMaterialProperty)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The material property to retrieve.

    Returns
    Type Description
    Color

    The color value if it exists; otherwise, the default color value.

    GetFloat(GenericMaterialProperty)

    Retrieves a float property from the material.

    Declaration
    public float GetFloat(GenericMaterialProperty genericMaterialProperty)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The material property to retrieve.

    Returns
    Type Description
    float

    The float value if it exists; otherwise, the default float value.

    SetColor(GenericMaterialProperty, Color)

    Sets a color property on the material.

    Declaration
    public void SetColor(GenericMaterialProperty genericMaterialProperty, Color color)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The material property to set.

    Color color

    The color value to assign.

    SetFloat(GenericMaterialProperty, float)

    Sets a float property on the material.

    Declaration
    public void SetFloat(GenericMaterialProperty genericMaterialProperty, float value)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The material property to set.

    float value

    The float value to assign.

    SetTexture(GenericMaterialProperty, Texture)

    Sets a texture property on the material.

    Declaration
    public void SetTexture(GenericMaterialProperty genericMaterialProperty, Texture texture)
    Parameters
    Type Name Description
    GenericMaterialProperty genericMaterialProperty

    The material property to set.

    Texture texture

    The texture value to assign.

    In this article
    Back to top Generated by DocFX