浏览代码

VR Laser color change

sebavan 6 年之前
父节点
当前提交
13ca613447
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/Cameras/VR/vrExperienceHelper.ts

+ 8 - 0
src/Cameras/VR/vrExperienceHelper.ts

@@ -522,6 +522,10 @@ export class VRExperienceHelper {
      * If the gaze trackers color should be updated when selecting meshes
      */
     public updateGazeTrackerColor = true;
+    /**
+     * If the controller laser color should be updated when selecting meshes
+     */
+    public updateControllerLaserColor = true;
 
     /**
      * The gaze tracking mesh corresponding to the left controller
@@ -2014,6 +2018,10 @@ export class VRExperienceHelper {
      * @param color new color for the ray.
      */
     public changeLaserColor(color: Color3) {
+        if (!this.updateControllerLaserColor) {
+            return;
+        }
+
         if (this._leftController) {
             this._leftController._setLaserPointerColor(color);