Loading...
Searching...
No Matches
Public Member Functions |
Static Public Member Functions |
Public Attributes |
Properties |
List of all members
realvirtual.MaterialDatabase Class Reference
Database of standard realvirtual materials that can be loaded at runtime. More...
Inheritance diagram for realvirtual.MaterialDatabase:
Public Member Functions | |
| Material | GetMaterial (string name) |
| Gets a material by name from the database using O(1) lookup. | |
| bool | TryGetMaterial (string name, out Material material) |
| Tries to get a material by name, with detailed logging. | |
| void | RebuildLookup () |
| Rebuilds the internal lookup dictionary (call after modifying standardMaterials) | |
| bool | HasMaterial (string name) |
| Checks if a material with the given name exists in the database. | |
Static Public Member Functions | |
| static void | ClearInstanceCache () |
| Clears the cached instance (call when database changes) | |
Public Attributes | |
| Material[] | standardMaterials |
Properties | |
| static MaterialDatabase | Instance [get] |
| Gets the MaterialDatabase instance from Resources. | |
| int | MaterialCount [get] |
| Gets the total count of materials in the database. | |
Detailed Description
Database of standard realvirtual materials that can be loaded at runtime.
This allows GLB runtime imports to reference existing materials instead of creating new ones.
Member Function Documentation
◆ ClearInstanceCache()
|
static |
Clears the cached instance (call when database changes)
◆ GetMaterial()
| Material realvirtual.MaterialDatabase.GetMaterial | ( | string | name | ) |
Gets a material by name from the database using O(1) lookup.
- Parameters
-
name The exact name of the material to find
- Returns
- The material if found, null otherwise
◆ HasMaterial()
| bool realvirtual.MaterialDatabase.HasMaterial | ( | string | name | ) |
Checks if a material with the given name exists in the database.
- Parameters
-
name The material name to check
- Returns
- True if material exists, false otherwise
◆ RebuildLookup()
| void realvirtual.MaterialDatabase.RebuildLookup | ( | ) |
Rebuilds the internal lookup dictionary (call after modifying standardMaterials)
◆ TryGetMaterial()
| bool realvirtual.MaterialDatabase.TryGetMaterial | ( | string | name, |
| out Material | material | ||
| ) |
Tries to get a material by name, with detailed logging.
- Parameters
-
name The material name to find material The found material, or null
- Returns
- True if material was found
Property Documentation
◆ Instance
|
staticget |
Gets the MaterialDatabase instance from Resources.
Returns null if no database is configured.
◆ MaterialCount
|
get |
Gets the total count of materials in the database.