I'm trying to learn how to write tests in Unity3D, but the documentation is sparse.
You can use [UnityTest]
on both PlayMode or EditMode tests, but I don't understand the significance in choosing one over the other. I think in PlayMode, it actually runs your game, but I still don't understand why I would or would not want that.
Vuforia Play Mode is fully integrated in Unity and it is the quickest way to test your projects during development right at your PC or Mac. Use the Webcam, Simulator or Recording Play Mode that is distributed with the Vuforia Engine SDK for Unity to fast-track your development process.
The Object mode is the standard Unity edit mode: when you make a selection in Object mode, you are selecting the entire Mesh. The other three modes are collectively called the Element modes. These allow you to select and modify the individual elements of the geometry that make up a Mesh: Vertices, Edges, and Faces.
It is actually quite simple:
Check anything that doesn't require PlayMode (Update
, Awake
, Start
etc) or that has to be tested explicitly before entering it e.g.
Camera
in the Scene?0, 0, 0
before the playmode starts?PhysicsRaycaster
component to make IPointerXxx
interfaces workor also the functionality of custom editor scripts.
For some it is necessary to test them before entering PlayMode, for the rest this method is simply faster since it doesn't have to initialize everything in your Scene before being able to test one specific thing.
Check scripts that require runtime (Update
, FixedUpdate
, etc), everything initialized (executed Awake
, Start
, etc) or physics e.g.
while
loop terminate (within a given time)?0.99
will the ball stop jumping after X seconds?If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With