Time for action – Testing our application using Unity Remote

Now that we have Unity Remote deployed we can get to the business of using our iOS device as a controller in our game development environment:

  1. Run Unity Remote on your device and a list of the machines ready to provide data for Unity Remote will appear in the list. If, for some reason, yours doesn't because of specific DNS or Bonjour security, you can enter the IP address of the machine you want to control by selecting the button in the lower left. If you don't really care to simulate the visual interface of the game on the iOS device you can change the radio button for Show image to Off and the game's frames will not be displayed on your device, yet you will still be able to control the game inside of Unity with your iOS device acting as a controller:
    Time for action – Testing our application using Unity Remote
  2. Press Play in the Unity toolbar. This will be the signal for Unity and Unity Remote to begin exchanging data. The content that is in the Game view will begin to appear on the iOS device, though you may think something is wrong the first time you see it as it will appear to be a much lower resolution version of your game:
    Time for action – Testing our application using Unity Remote

    Game View representation of the game in Unity

    If you recall, I mentioned that Unity streams the game to the iOS device. What the IDE is doing is actually streaming the video of what's happening in the game to your device so you will see a variety of compression artifacts, depending on your Wi-Fi connection speed and other factors:

    Time for action – Testing our application using Unity Remote

    View of the game on Unity Remote

  3. This is a normal behavior of Unity Remote (and one of the reasons for the Show Image radio button) and should not detract in any way from your ability to perform your testing. Remember, this is purely a testing tool to enable rapid development so visual fidelity is not necessary. If you really need to know exactly how its going to look, you can deploy the game to the device – but bookmark this chapter as you will find that after some time the benefit of knowing how great your content looks on the device will pale into comparison to being more productive using Unity Remote.

What just happened?

What Unity Remote is doing behind the scenes is getting the frame buffer of the application and compressing that into a video stream and streaming that over to the iOS device. Any device input that is gathered through the iOS device is then transmitted through Wi-Fi to the Unity IDE and used to direct the objects in the environment. Whenever you enter Play mode in the Editor, your device will become the remote control for testing the game.

While this approach is very useful for rapid application development, it is important to note that performance using this approach is approximated at best and you will still want to build and run your application on your device exclusively every so often, to confirm that performance and gameplay is as you expect. Similarly, it is important to note that this approach is very dependent on your Wi-Fi connection. If your device isn't showing a full Wi-Fi signal you can expect significant performance implications.

We have just performed all of the steps necessary to setup our development environment and publish content to Unity. Further we have built our own mini testing lab using Unity Remote so we can utilize our device, yet debug the game in our development environment. This is a crucial milestone as we can now focus entirely on customizing Unity and building games.

One last thing about Unity Remote that is worth noting, while I had you build the remote application yourself you can actually download this in the App Store. Given this you may be asking yourself then why did you have me build it? As an iOS developer, even one using Unity, there are a number of times that you will find yourself needing to debug what is happening under the covers with XCode. In addition, you may find yourself wanting to integrate with some native feature of iOS that isn't supported in Unity. In all of these scenarios you will find yourself digging through the underlying XCode project, so now seemed to be the best time to get familiar with how things are put together.

Links to the Unity Remote:

Pop quiz – doing the thing

  1. Where can Unity views be displayed?
    1. Toolbar
    2. Undocked on different screens
    3. In Tabs
    4. Remotely on the iOS device
    5. On other Unity machines
  2. Where can you go to set up an application ID for your iOS device?
    1. Apple Developer Forums
    2. XCode Organizer
    3. iTunes Connect
    4. iOS Provisioning Portal
    5. XCode SDK
  3. The Unity interface can only be customized for one user and use case? (true/false)
  4. Unity Remote works over 3G Connections? (true/false)
  5. You have to build Unity Remote in order to perform remote debugging? (true/false)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.204.201