Debugging the Debug Toggle, and Playtesting
To begin, it was decided that using a Resources folder would cause building the game to take far too long, so I had to rework the randomized artwork of the loading screen to use a different method. I still thought that a public list would be difficult for artists to add any artwork, so after a significant amount of research, and discussion with other programmers, I decided to use a new experimental feature of unity called sprite libraries. It essentially is a type of asset file that can have multiple sprites added into different categories, and can be referenced by other experimental components. At first, I had intended on just using the sprite library asset, and getting the sprites inside it with my own code, but I quickly learned that this would be difficult as most of the sprite library's functions were either internal or private. So I ended up adding a SpriteResolver, another experimental component which uses a sprite library to set the sprite of a sprite renderer component on the same gameobject. One issue I ran into that took me far longer to resolve than it should have is that I needed to add 'using UnityEngine.Experimental.U2D.Animation' to actually reference the SpriteResolver and SpriteLibrary components. I ended up spending more time than I should have trying to figure what had been going wrong only to figure this out later. During this process, I ran into a issue with git, which caused over a hundred files to be changed/corrupted, and after several hours of trying to troubleshoot by resetting the branch, reverting commits etc, I ended up copying what work I had into a seperate folder, recloning the repo, making a new local branch, and pasting my changes back in. This took around 4 hours In the end, I managed to get everything work, and for artists to add any new concept art in, all they had to do was add it to the sprite library asset called Concept Art, which shows every image inside in the editor, making it far eaiser to use than a public list. The loading screen now shows a random piece of concept art. Excluding the git issues, this took around 14 hours.
The next task I was assigned was creating a global debug toggle, and a corresponding in game console command using the developer console. After familiarizing myself with how the debug text was handled in the enemies, I added a global bool to the game manager that could be referenced by each enemy. Afterward, I figured out how the developer console worked, and added a command that would allow the user to toggle the bool in the game manager in-game, so the debug text could be turned on and off in-game. This took around 5 hours.
I spent an embarrasing amount of time trying to figure out why I was not able to get any functions or references of
sprite resolver and sprite library to work, when the problem was I had not added 'using UnityEngine.Experimental.U2D.Animation'
to the script file. I learned that I should more thorougly read the documentation and the code of any unfamiliar
components before I use them, even more so if they are experimental.
I am also still unsure what caused the issue with git to happen. I was lucky this time in that was able to preserve
most of my work, but if a problem like this happens again in the future, I might not be as lucky. I am currently
trying to figure out what might have went wrong, and I believe it may have to do with a pull not completing itself
properly due to weak internet connection, but I am still not completely sure.