Hello!
I have a lot of free time and I want the project I'm working on to be as clean as possible, even though it means a lot more work for me. I've started creating those cards that show the rough component structure for the game elements:
Here is one for a NPC character (all the components are children of the Mouse scene). Every mouse can work in one of the different workplaces. When employed, the work component will be changed accordingly to match the work type. And as you can see some of the components require others (like the detector component here). It's easy to set up the hunger component for example, because it's present in the scene from the beginning and I can just have an export variable pointing to the detector and set it in the editor. However it's another situation for the work component, because the base class doesn't require a reference to the detector and the inheriting components do.
My question is, how to correctly pass the reference to the detector when for example gatherer component is set?
The only option I see is getting it by its path, whether it's done by the gatherer component, or by the workplace or whatever else. Of course I know that it works, but it's not what I want. I want the perfect components that are fully independent from each other, but I don't know if that's even possible. This would be the only place where they lose independency from each other and it bugs me a lot.
I know it's probably a very stupid question, but if you know any way around it, please let me know. And please don't respond to just do it in whatever way works, it's not the point of my question.