Exposed Property Class | Visual Effect Graph | 8.0.1
docs.unity3d.com
    Show / Hide Table of Contents
    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
    }
    
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023