To PlayMode and unit test a player health bar, follow these steps:
- Create a new 3D Unity project and delete the default folder called Scenes.
- In the Package Manager window, ensure that you have the latest version of the Test Framework package installed.
- Import the Unity package provided (healthBarScene.unitypackage).
- Open the HealthBarScene scene and add this scene to the project's Build (menu: File | Build Settings ...).
- Display the Test Runner window by going to Window | General | Test Runner.
- We need to enable PlayMode tests for all assemblies. Do this by displaying the drop-down menu in the top-right corner of the Test Runner window and selecting EnablePlayMode tests for all assemblies (click OK for any message concerned with restarting the editor).
- Now, we have to restart the Unity Editor (just close the application and then reopen it with your project).
- Since our PlayMode...