Experimental: This feature is currently experimental and is subject to change in later major versions. To use this feature, enable Experimental Operators/Blocks in the Visual Effects tab of your Project's Preferences.
Exposed Property class
The ExposedProperty
class is a helper class that stores a property ID based on the property's name. The value that you assign to an ExposedProperty
is the string name of a Shader property. The class automatically calls the Shader.PropertyToID(string name)
function with the Shader property name as the parameter and stores the integer ID the function returns. When you use this class in a Property, Event, or EventAttribute method in the component API, it implicitly uses this integer.
When you want to access a Shader property, you can either use the property's name or its ID. It is often easier to use the name of the property, however it is more efficient to use the property's integer ID. This class is useful because it combines the convenience of using the property name with the efficiency of using the property ID.
Code example
ExposedProperty m_MyProperty;
VisualEffect m_VFX;
void Start()
{
m_VFX = GetComponent<VisualEffect>();
m_MyProperty = "My Property";
}
void Update()
{
m_VFX.SetFloat(m_MyProperty, someValue);
}
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.