Oculus XR Plugin APIs | Oculus XR Plugin | 1.0.3-preview.1
docs.unity3d.com

    Oculus XR Plugin APIs

    Unity.XR.Oculus.Utils.SetColorScaleAndOffset

    public static void SetColorScaleAndOffset(Vector4 colorScale, Vector4 colorOffset);

    Parameters colorScale - Scales the eye layer texture color by this Vector. Vector components are expected to be a value from 0.0 to 1.0.

    colorOffset- Offsets the eye layer texture color by this Vector. Vector components are expected to be a value from 0.0 to 1.0.

    public class LerpColorScale : MonoBehaviour
    {
        // Update is called once per frame
        void Update()
        {
            // animate the color scale value 
            float value =  0.5f * (1.0f + Mathf.Sin(2.0f*Mathf.PI * 0.1f* Time.time));
    
            // sets the color scale and offset on the Oculus XR Plugin.
            // with the animation defined above this causes a constant "fade in" -> "fade out" effect.
            Unity.XR.Oculus.Utils.SetColorScaleAndOffset(new Vector4(value,value,value,value), Vector4.zero);
        }
    }
    
    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