Description
The Name
property of the Material
class represents the name or path of the material. This property is used to identify the material within the Sandbox environment, allowing for easy reference and management of materials in your game or application.
Usage
To access or modify the Name
property of a Material
instance, you can use the following syntax:
Example
// Create a new material
Material myMaterial = new Material();
// Set the name of the material
myMaterial.Name = "MyCustomMaterial";
// Retrieve the name of the material
string materialName = myMaterial.Name;
// Output the material name
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use in-game UI or logging systems to display information
// Example: Log.Info(materialName);