Editor debugging
It's sometimes claimed that Unity has no debugging tools built into the editor, but this is not quite true. With Unity, you can play your game and edit the scene at the same time while the game is running. You can even observe and edit properties in the Object Inspector, both private and public, as we saw earlier. This can give you a complete and graphical picture of your game at runtime; and allow you to detect and observe a wide range of potential errors. This form of debugging should not be underestimated. To get the most from in-editor debugging, activate the Debug mode from the Object Inspector by clicking on the context menu icon in the top-right corner of the inspector and then choose Debug from the menu, as shown here:
Next, make sure that your viewports are configured appropriately so that they allow you to see both the Scene and Game views simultaneously during the Play mode, along with the Stats panel. To achieve...