Is it possible make a generic getComponent() function?
I’m trying to create a generic class and has T extends Component.
But I can’t get the component by calling something like getComponent()
Is there any workaround?
Is it possible make a generic getComponent() function?
I’m trying to create a generic class and has T extends Component.
But I can’t get the component by calling something like getComponent()
Is there any workaround?
Hello there!
Try checking this out:
https://docs.cocos.com/creator/manual/en/scripting/access-node-component.html
I hope it helps!