Oculus XR Plugin APIs | Oculus XR Plugin | 1.0.3-preview.1
docs.unity.cn

    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 © 2019 Unity Technologies
    Generated by DocFX