How to do it...

To PlayMode test a door animation, follow these steps:

  1. Create a new Unity project, and delete the default folder Scenes.
  2. Import the Unity package provided (doorScene.unitypackage).
  3. Add the following scenes – doorScene and menuScene – to the project Build (the sequence doesn't matter).
  4. Ensure that the scene currently open is menuScene.
  5. Display the Test Runner panel by choosing the following menu: Window | General | Test Runner
  6. Enable playmode tests for all assemblies. Do this by displaying the drop-down menu in the top-right corner of the Test Runner panel, and selecting Enable playmode tests for all assemblies (click OK to any message concerned with restarting the editor).
  7. Now restart the Unity Editor (just close the application ...

Get Unity 2018 Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.