瀏覽代碼

SelectionHelper: Add enabled property. (#26483)

puxiao 2 年之前
父節點
當前提交
11b7b5c1ac
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      examples/jsm/interactive/SelectionHelper.js

+ 7 - 0
examples/jsm/interactive/SelectionHelper.js

@@ -15,9 +15,12 @@ class SelectionHelper {
 		this.pointBottomRight = new Vector2();
 
 		this.isDown = false;
+		this.enabled = true;
 
 		this.onPointerDown = function ( event ) {
 
+			if ( this.enabled === false ) return;
+
 			this.isDown = true;
 			this.onSelectStart( event );
 
@@ -25,6 +28,8 @@ class SelectionHelper {
 
 		this.onPointerMove = function ( event ) {
 
+			if ( this.enabled === false ) return;
+
 			if ( this.isDown ) {
 
 				this.onSelectMove( event );
@@ -35,6 +40,8 @@ class SelectionHelper {
 
 		this.onPointerUp = function ( ) {
 
+			if ( this.enabled === false ) return;
+
 			this.isDown = false;
 			this.onSelectOver();