-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix camera crash error in Script #1873
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev/1.2 #1873 +/- ##
===========================================
+ Coverage 66.71% 66.90% +0.18%
===========================================
Files 472 471 -1
Lines 23799 23834 +35
Branches 3393 3399 +6
===========================================
+ Hits 15877 15945 +68
+ Misses 6732 6697 -35
- Partials 1190 1192 +2
☔ View full report in Codecov by Sentry. |
const { _activeCameras: cameras } = scene; | ||
const { _activeCameras: cameras } = scene._componentsManager; | ||
const elements = cameras._elements; | ||
|
||
for (let j = cameras.length - 1; j >= 0; j--) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cameras should be elements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's DisorderedArray
continue; | ||
} | ||
|
||
cameras.forEach( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use forEach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is DisorderedArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Demo: