MaterialAccessorclass
A wrapper to allow the unification of editing materials. This is usually a member on a Component which implements MaterialAccessor.ITarget.
Constructors1
Showing 1 constructors
public MaterialAccessor(Sandbox.Engine.MaterialAccessor.ITarget renderer)
Create a new material accessor for this object.
| Parameter | Type | Description |
|---|---|---|
| renderer | ITarget | — |
No results match this filter.
Methods5
Showing 5 methods
public void Apply()
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.
void—public Sandbox.Material GetOriginal(int i)
Get the original material for the specified index.
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
public Sandbox.Material GetOverride(int i)
Get the override material for this slot. Or null if not set.
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
public bool HasOverride(int i)
Does this index have an override material?
| Parameter | Type | Description |
|---|---|---|
| i | int | — |
bool—No results match this filter.
Properties1
Showing 1 properties
public int Sandbox.Engine.MaterialAccessor.Count { get; set; }
Total number of material slots
int—No results match this filter.