Пример #1
0
        void setupVariables()
        {
            input            = InputBridge.Instance;
            playerController = GetComponent <BNGPlayerController>();
            controller       = GetComponentInChildren <CharacterController>();
            cameraRig        = playerController.CameraRig;
            fader            = cameraRig.GetComponentInChildren <ScreenFader>();

            // Make sure teleport line is a root object
            if (TeleportLine != null)
            {
                TeleportLine.transform.parent   = null;
                TeleportLine.transform.position = Vector3.zero;
                TeleportLine.transform.rotation = Quaternion.identity;

                _initialLineWidth = TeleportLine.startWidth;
            }

            if (CollisionLayers == 0)
            {
                Debug.Log("Teleport layer not set. Setting Default.");
                CollisionLayers = 1;
            }

            // HTC Uses a Trackpad that is recognized as a Thumbstick. Force to Hold Downmode
            if (ControlType == TeleportControls.ThumbstickRotate && input.IsHTCDevice)
            {
                Debug.Log("HTC Device detected, switching Teleport Mode to Thumbstick Down");
                ControlType = TeleportControls.ThumbstickDown;
            }

            setVariables = true;
        }
Пример #2
0
        void setupVariables()
        {
            input            = GetComponent <InputBridge>();
            playerController = GetComponent <BNGPlayerController>();
            controller       = GetComponentInChildren <CharacterController>();
            cameraRig        = GetComponentInChildren <OVRCameraRig>().transform;

            // Make sure teleport line is a root object
            if (TeleportLine != null)
            {
                TeleportLine.transform.parent = null;
                _initialLineWidth             = TeleportLine.startWidth;
            }

            if (CollisionLayers == 0)
            {
                Debug.Log("Teleport layer not set. Setting Default.");
                CollisionLayers = 1;
            }

            // HTC Uses a Trackpad that is recognized as a Thumbstick. Force to Hold Downmode
            if (ControlType == TeleportControls.ThumbstickRotate && input.IsHTCDevice())
            {
                Debug.Log("HTC Device detected, switching Teleport Mode to Thumbstick Down");
                ControlType = TeleportControls.ThumbstickDown;
            }

            setVariables = true;
        }