Draft: The content on this page is complete, but it has not been reviewed yet.
Experimental: This Feature is currently experimental and is subject to change in later major versions.
Exposed Property Class
ExposedProperty
class is a helper class that caches a property ID based on its name. You can assign a string name to the class, and It will automatically cache the integer value from Shader.PropertyToID(string name)
and cast implicitly to this integer when used in Property, Event or EventAttribute methods of the Component API
Example Usage
ExposedProperty m_MyProperty;
VisualEffect m_VFX;
void Start()
{
m_VFX = GetComponent<VisualEffect>();
m_MyProperty = "My Property"; // Assign A string
}
void Update()
{
vfx.SetFloat(m_MyProperty, someValue); // Uses the int ID prototype
}