示例#1
0
 void Reset()
 {
     laser = FindObjectOfType <VRLaserPointer>();
     if (GetComponent <RectTransform>())
     {
         Bounds bounds = GetComponent <RectTransform>().GetBounds();
         cornerA = new Vector2(bounds.min.x, bounds.max.y);
         cornerB = new Vector2(bounds.max.x, bounds.min.y);
     }
 }
示例#2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        GUILayout.Space(5);

        VRLaserPointer script = (VRLaserPointer)target;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Turn on"))
        {
            script.TurnOn();
        }
        if (GUILayout.Button("Turn off"))
        {
            script.TurnOff();
        }
        GUILayout.EndHorizontal();
    }
示例#3
0
 /// <summary>
 /// Refreshes the FPFC Variables.
 /// </summary>
 public void Refresh()
 {
     _firstPersonFlyingController = Resources.FindObjectsOfTypeAll <FirstPersonFlyingController>().FirstOrDefault();
     _vrInputModule  = _firstPersonFlyingController.GetField <VRInputModule, FirstPersonFlyingController>("_vrInputModule");
     _camera         = _firstPersonFlyingController.GetField <Camera, FirstPersonFlyingController>("_camera");
     _vrLaserPointer = _firstPersonFlyingController.GetComponentInChildren <VRLaserPointer>();
     _vrInputModule.transform.SetParent(transform);
     if (_originalOriginLocation == null)
     {
         _originalOriginLocation = _firstPersonFlyingController.transform;
     }
     if (_helper.currentXRDeviceModel == XRDeviceModel.Unknown)
     {
         _camera.fieldOfView = _options.CameraFOV;
     }
     _firstPersonFlyingController.transform.SetParent(transform);
     _firstPersonFlyingController.SetField("_cameraFov", _options.CameraFOV);
     _firstPersonFlyingController.SetField("_moveSensitivity", _options.MoveSensitivity);
     _leftController  = _firstPersonFlyingController.GetField <VRController, FirstPersonFlyingController>("_controller0");
     _rightController = _firstPersonFlyingController.GetField <VRController, FirstPersonFlyingController>("_controller1");
 }
示例#4
0
 private void Start()
 {
     controller   = GetComponent <Hand>();
     laserPointer = GetComponent <VRLaserPointer>();
 }
示例#5
0
 private void Awake()
 {
     Instance = this;
     laser    = GetComponent <LineRenderer>();
 }