youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Change our naming scheme for levels #87

Open holke opened 4 years ago

holke commented 4 years ago

We first implemented level3 and then decided to change level3 to level4. This means that we have to rename some ~20 scripts, classes and game objects from "level3" to "level4". This is a tedious and error prone process and we should avoid having to do this again in the future, when we decide to squeeze in another level.

I suggest that we use a different naming scheme for our levels that is more robust against adding new levels in between.

How about:

holke commented 4 years ago

Started by renaming all levels. The names don’t have numbers anymore.

holke commented 4 years ago

I am not done yet xD

maccxs commented 4 years ago

Ups 😬 Ich dachte du wolltest es in zwei requests aufteilen

Von meinem Telefon gesendet

Am 01.05.2020 um 21:08 schrieb holke notifications@github.com:

 I am not done yet xD

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

holke commented 4 years ago

Maybe the merge request closed the issue automatically? I will split this in 2 mr, so it was good that the first mr is merged.

maccxs commented 4 years ago

If you link this to the merge request the mr closes the issue automatically.

holke commented 4 years ago

I see, that’s annoying.

maccxs commented 4 years ago

It would also be possible to use directories for the different scenes which really makes it easier to find stuff. And you do not have to give unity the whole path, it still finds the scene. Maybe we should use directories for the levels and the scripts that belong to the levels in the script and scene folder, respectively.

holke commented 4 years ago

yes we should. It starts to get crowded.

holke commented 4 years ago

This

NextLevel = LevelList.GetNextLevel("CollectMasks"); UnityEngine.SceneManagement.SceneManager.LoadScene(NextLevel); is more or less exactly what we are doing now in the new Menu. It is not necessary to give the level a specific name for this. Unity knows the order form the build settings and we can navigate to the current, next (and previous) level that way.

We still have some if levelname == STRING constructs in the code that i would love to eliminate.