Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
0
Found in
2018.4
2020.1.0f1
2020.2
Issue ID
1278540
Regression
No
Creating built-in Component Class does not give a warning when using the "new" keyword
How to reproduce:
1. Open the attached "New CharacterController No Warning.zip" project and Scenes/SampleScene scene
2. Enter the Play mode
3. Observe the Console window
Expected result: All built-in Components cause a warning
Actual result: Only calling the "new NewBehaviourScript()" causes a warning
Reproducible with: 2018.4.27f1, 2019.4.11f1, 2020.1.6f1, 2020.2.0b3
Note: Not reproducible when creating MonoBehaviour using the "new" keyword
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Resolution Note:
Given that there is no real danger in using new on a Component, we will not add a Runtime check to this part yet.
Instead the plan is to add this as a compile time check. This will also make sure there is no extra checks for components at runtime, and no extra cost.
This would also mean we can do the same trick for MonoBehaviours when this is added.