فهرست منبع

Editor: Clean up Viewport.Controls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mr.doob 1 ماه پیش
والد
کامیت
a97401bca9
1فایلهای تغییر یافته به همراه11 افزوده شده و 3 حذف شده
  1. 11 3
      editor/js/Viewport.Controls.js

+ 11 - 3
editor/js/Viewport.Controls.js

@@ -26,7 +26,7 @@ function ViewportControls( editor ) {
 
 		if ( object.isCamera ) {
 
-			update( false );
+			updateCameraList();
 
 		}
 
@@ -59,7 +59,7 @@ function ViewportControls( editor ) {
 
 	//
 
-	function update( effect = true ) {
+	function updateCameraList() {
 
 		const options = {};
 
@@ -79,7 +79,15 @@ function ViewportControls( editor ) {
 			: editor.camera;
 
 		cameraSelect.setValue( selectedCamera.uuid );
-		if ( effect ) editor.setViewportCamera( selectedCamera.uuid );
+
+		return selectedCamera;
+
+	}
+
+	function update() {
+
+		const selectedCamera = updateCameraList();
+		editor.setViewportCamera( selectedCamera.uuid );
 
 	}
 

粤ICP备19079148号