Micky774 / unity_project

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Maybe we should make a simple EnemyController script #23

Open AnonymousFool opened 1 year ago

AnonymousFool commented 1 year ago

I had a thought of something that's not currently a task, but might be beneficial at some future point. We have a GameObject called Enemies that we make the parent GameObject of all the enemies, but currently it doesn't actually do anything other than provide us organizational utility.

We also currently have every enemy individually find the player with FindGameObjectWithTag("player") because we can't assign the player at compile-time. We're eventually going to want a more complicated enemy controller to handle enemy spawning and loading and unloading and stuff, but we could already benefit from one by having it perform the FindGameObjectWithTag function once, save the result, and let all the enemies access the value from Enemies, which will allow us to avoid some redundant computations.

New low priority task?

Micky774 commented 1 year ago

I think I agree that it will eventually be necessary. Part of me wants to wait until we have a greater understanding of the use-cases for such a controller so we can make more informed decisions about its designs. With that being said, getting it started now and keeping it as flexible as possible to grow as we run into new problems may be the way to go.

It is not something I see as a high priority, but I agree with its eventual inclusion. I think we should wait until we see an opportunity for some more significant benefits until we begin actual work on it. Thoughts?

@JosriqueJotaro @Nick-Angel