s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejams

Game Jam III

Starts Fri 4 Sep
Theme

Theme revealed when the jam starts.

£50,000
prizepool
Read more
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
Classes
MaterialAccessor
chevron_left Classes
class
MaterialAccessor

Constructors

functionsMaterialAccessor

Properties

data_objectCount

Methods

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

Examples

MaterialAccessor materialAccessor;

[Property]
public MaterialAccessor Materials => materialAccessor ??= new MaterialAccessor( this );

build Constructors 1

MaterialAccessor (renderer)
Create a new material accessor for this object.

data_object Properties 1

Count
int
Total number of material slots

functions Methods 5

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.
GetOriginal (i)
Material
Get the original material for the specified index.
GetOverride (i)
Material
Get the override material for this slot. Or null if not set.
HasOverride (i)
bool
Does this index have an override material?
SetOverride (i, material)
Set an override material for this slot. If the material is null, it will clear the override.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter