Quantcast
Channel: Answers by "dubbreak"
Viewing all articles
Browse latest Browse all 68

Answer by dubbreak

$
0
0
Nothing bad about empty game objects from a performance perspective (no draw calls since it doesn't have a renderer and very low mem overhead, plus you have to store it somehow). There are lots of ways to skin this cat and empty objects is one of them. Create a prefab for each of your ship types with empty objects for the locations. Then reference them in the ship script. public transform weaponLocationStarboard; You could also add a script to your "empty" object so that you can add info to your weapon locations. When I have a lot of objects subbed to something I'll usually have a class/script I attach so I can do something like: private MyThing[] myThings; void Start () { //get ALL the things myThings = this.GetComponentsInChildren().OrderBy(n => n.ID).ToArray (); } In some situations it's a lot easier (e.g. 20 slots you need ordered from id 1-20).

Viewing all articles
Browse latest Browse all 68

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>