Пример #1
0
        public static Transform AddCameraFade()
        {
            var camera = VRTK_DeviceFinder.HeadsetCamera();

            VRTK_SDK_Bridge.AddHeadsetFade(camera);
            return(camera);
        }
        private void Update()
        {
            if (rotateTowards == null) // Backup
            {
                rotateTowards = VRTK_DeviceFinder.HeadsetCamera().gameObject;
                if (rotateTowards == null)
                {
                    Debug.LogWarning("The IndependentRadialMenu could not automatically find an object to rotate towards.");
                }
            }

            if (menu.isShown)
            {
                if (interactingObjects.Count > 0) // There's not really an event for the controller moving, so just update the position every frame
                {
                    base.DoChangeAngle(CalculateAngle(interactingObjects[0]), this);
                }

                if (rotateTowards != null)
                {
                    transform.rotation = Quaternion.LookRotation((rotateTowards.transform.position - transform.position) * -1, Vector3.up) * initialRotation; // Face the target, but maintain initial rotation
                }
            }
        }