-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow us to strongly type packed scenes #782
Comments
I actually get autocompletion for packed scenes, so I think this isn't needed. If you are programmatically loading PackedScenes, you can always define the type after instancing it. |
autocompletion has nothing to do with this problem it has to do with type safety |
Ah, gotcha. That is something I didn't think about. |
using this suggestion #1207
|
closing in favor of.. |
reopening due to people might needing to export packed scenes only instead of both packed scenes and nodes |
This might be better as...
This we can drag in a scene or a node as long as it's that type. |
I'd love to see this feature, coming from a unity background, but I'd really prefer if scenes and nodes inside scenes didn't both fit in the same variable. I can't think of any situation where you'd actually want a variable that could be either one, you'll have references to other nodes in the scene you're in and you'll have references to scenes you want to instantiate at runtime, but not both in the same box. |
If #1935 was implemented, then you actually could treat a node class as equivalent to its bound scene (if any) at runtime, since instantiating the node would automatically instantiate the scene. This would then permit us to extend that equivalence to the editor, offering the corresponding type safety and autocompletion improvements. You could, admittedly, not expect that a |
Describe the project you are working on:
3d Tower defense
Describe the problem or limitation you are having in your project:
there is no way to strongly type packed scenes
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
can we have a some sort of generics for packed scenes that allow for strongly typed instancing
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
something like..
exporting generic packed scenes would also insure type safety in the inspector
If this enhancement will not be used often, can it be worked around with a few lines of script?:
it would be used alot and no not safely
Is there a reason why this should be core and not an add-on in the asset library?:
supports better code
The text was updated successfully, but these errors were encountered: