I have a bunch of creeps on a map. I need to save their location in a list when they enter a trigger and remove them when they leave. I also have to sort that list by their ID.
My question here is Is it cheaper performance wise to have 2 lists one holding the transform and the other it’s component? Or would it make a difference accessing each component to each transform? (this will be called often.)
I assume having the 2 lists is just a slight increase in memory but a huge savior on performance since it is not required to get the component? I am also assuming getting the component is done with reflection?)
lol I'm an idiot... I don't know why I was trying to go one script farther. lol I was getting the ID from a stats script which does not inherit mono. Completely forgetting about my creepController script that uses the creepStats. Thanks for pointing that out.
– Vunpac