If I pass bullet.tscn into another method, can I derive the class (i.e. bullet.cs) from the PackedScene in order to access the properties and methods on the class?
Is it possible to access the class from the packedscene?
I don't know. You might be able to, but I'm not totally sure how.
You might be able to determine the type of the class through the SceneState, which you can get from the packed scene using the get_state
function. From there you could potentially figure out the type using the get_node_type function.
The data stored in _bundled
might also be something to look into, as apparently it is a dictionary representation of the contents of the PackedScene. The data under the "nodes" key probably contains the data class itself.
Hopefully this is of some help!
Thanks for the suggestions. Whilst GetNodeType did work, it still left me with having to pass in a string rather than a class. I'll stick to creating multiple scenes and attaching them to an exported variable on the tank.