DemoProductions / shmup

3 stars 2 forks source link

Enemy disabled till visible #88

Closed flip40 closed 8 years ago

flip40 commented 8 years ago

EnemyMovement and BoundingsTimeout2D are disabled until it becomes visible in the main camera.

Used RequireComponent to make sure we have these scripts attached. I figured this was a tad better than checking "if script" everywhere we might need to. Note that this only works for components, this will not work for Weapon, as it is a prefab / instance and should be checked before use. Also note that this only adds components it needs when the script itself is added (if it needs to), it won't make changes after it has already been added.

85