I think what I would do is have a script which handles the health bar drawing. The spaceships can then individually call this script and tell the script that they are close enough to be drawn, or have moved too far away to be visible. All the health bar script then needs do is iterate over the list of spaceships it contains and draw the health bar for each.
↧