- Home /
Storing Data and Access Efficiency
I have an array of weapon objects. I am trying to access them individually to pull out a texture variable. Should I create a base weapon class and modify the variables directly in the inspector, or create a mace/sword/spear class that extends the base weapon class? I would extend it, but accessing the textures for each specific weapon would be hard opposed to using a GetComponent(scriptWeapon) once, to saying GetComponent(scriptWeaponMace), GetComponent(scriptWeaponSword). Which one should I do?
Your answer
Follow this Question
Related Questions
Problem with Singleton and NullReferenceException? 0 Answers
Need my function to work with different lists of different values (classes) 1 Answer
Calling functions from a class - Curious issue 1 Answer
View script variables within an array of scripts in Inspector 1 Answer
Storing questions/answers for a multiple choice game 1 Answer