API ReferenceSandbox.Engine

MaterialAccessorclass

A wrapper to allow the unification of editing materials. This is usually a member on a Component which implements MaterialAccessor.ITarget.

objectMaterialAccessor
Namespace
Sandbox.Engine
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.Engine.MaterialAccessor

Constructors1

Showing 1 constructors

Methods5

Showing 5 methods

public void Apply()PUBLIC

Apply to the object. You don't need to call this when setting overrides, as it will automatically apply them to the target when you set them. This is here as a convenience if this object holds data, and you need to apply it to another object that didn't exist when the overrides were originally set, or loaded.

Returns:void

public Sandbox.Material GetOriginal(int i)PUBLIC

Get the original material for the specified index.

ParameterTypeDescription
iint
Returns:Material

public Sandbox.Material GetOverride(int i)PUBLIC

Get the override material for this slot. Or null if not set.

ParameterTypeDescription
iint
Returns:Material

public bool HasOverride(int i)PUBLIC

Does this index have an override material?

ParameterTypeDescription
iint
Returns:bool

public void SetOverride(int i, Sandbox.Material material)PUBLIC

Set an override material for this slot. If the material is null, it will clear the override.

ParameterTypeDescription
iint
materialMaterial
Returns:void

Properties1

Showing 1 properties

public int Sandbox.Engine.MaterialAccessor.Count { get; set; }PUBLICGETSET

Total number of material slots

Returns:int

On this page