Test 03

Here we are adding the code to avoid more than a cube at a time.

public void OnCreate()

      if (GameObject.FindWithTag(CUBE) == null)


           Transform cube = Instantiate(this.CubePerefab, transform);

           cube.name = "object for test";



As you can see, the code is a little different from the final version of this method. In fact, in the final version there is one more line:



However, there are not other Acceptance Criteria that ask us to modify the behaviour of the “Create” button. Why that line appears in the final version of the code?


Back to: Test 02 Read next: Test 04


© 2017 Hud Dimension. All Rights Reserved.