Exemple #1
0
        /// <summary>
        /// before rendering this GO
        /// </summary>
        private void OnWillRenderObject()
        {
            VrManager vrManager = gameObject.transform.parent.gameObject.GetComponent <VrManager>();

            if (this.buf == null)
            {
                Debug.Log("cube OnWillRenderObject");
                this.buf      = new CommandBuffer();
                this.buf.name = "VR command";
                vrManager.DoTimeWarpWithCommandBuffer(vrManager.TimeWarpViewIndex, this.buf);
                Camera.current.AddCommandBuffer(CameraEvent.AfterEverything, this.buf);
            }
        }
Exemple #2
0
        /// <summary>
        /// Called when [click].
        /// </summary>
        public void OnClick()
        {
            Debug.Log("**** OnClick.");
            this.transform.GetComponentInChildren <Text>().text = (Random.value * 100).ToString();

            /* new api test
             * fovLevel++;
             * if (fovLevel > VrManager.FovLevel.Fov3)
             * {
             *  fovLevel = VrManager.FovLevel.Fov0;
             * }
             *
             * VrManager.SetFovMode(fovLevel);
             * //*/

            this.refreshRate++;
            if (this.refreshRate > VrManager.RefreshRateMode.Fps72)
            {
                this.refreshRate = VrManager.RefreshRateMode.Fps60;
            }

            VrManager.SetRefreshRateMode(this.refreshRate);
        }