Hi All,
Ive a set of ai bots in my project, they all share the same basic movement functions. But on top of this they have type specific action functions (ie prey,predator etc). In C++ I would normally make a base bot class with the movement functions in and then inherit form this to make my other specialsied bots.
Now I understand I can do this in unity but ive been reading that it might be better to do it through 2 seperate script components and interfacing. Im not sure how to do this.
I might need my inherited object to update variables of the base class (if it was inherited that would be fine) does this mean i have to keep ap pointer to the other base script compenent all the time and reference it that way? If so then thats fine, but it just seems like another level of ‘pointerness’ that unity already seems full of…Im not sure it would make any difference to performance once compiled, but it seems a lot less seamless than standard inheritance.
Whats the best approach…?
thanks