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
- "Problem detected while importing the Prefab file" errors on Learning Templates import
- Crash on RaiseException during Socket.BeginConnect in Player when application connection is blocked through commercial firewall
- Decal Projector produces artifacts when the normal and decal are projected in negative z-direction and Normal Blend is set to 1
- Undoing slider field change only resets slider position, doesn't undo the value change
- Precision changes when a tangent is added to a Vertex node
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.