Unity Apple TV

2 min. read

Unity: Apple TV (tvOS)

The Apple TV Remote (Siri Remote) serves as a multi-purpose input device, working both as a traditional menu navigation controller, game controller, gyro and acceleration sensor, and as a touch gesture device. Apple TV Remote input is minimally processed by Unity and mostly routed to corresponding Unity APIs.

MFi (Made for iOS)

The Apple TV Remote touch area is mapped both to Input.touches (Touch.type is set to Indirect and is ignored by the Unity GUI), and the usual Joystick Input API (e.g. Input.GetAxis(“Horizontal”); )

The Apple TV Remote acceleration and gyroscope are mapped accordingly to Input.acceleration and Input.gyro. Input.acceleration internally is derived from gyroscope API and might have some instabilities. Unfortunately there is no dedicated accelerometer API in the tvOS SDK. Input.gyro.attitude is derived from the gravity vector, and thus lacks rotation around the axis parallel to the gravity vector. The same applies for Input.gyro.rotationRate

The Pause/Play button on the remote is mapped to button “X” (which is then mapped to joystick button 15).

The Apple TV Remote touch area click is mapped to button “A” (which is then mapped to joystick button 14).

The Menu button has special behavior on this device; a long press invokes the tvOS task switcher. This behavior cannot be overridden. Short taps can be processed two ways:

References
https://docs.unity3d.com/Manual/tvOS.html

https://ipastore.me/how-to-find-your-apple-tv-4th-gen-udid/

MFi game Controller
https://docs.unity3d.com/Manual/iphone-joystick.html

On Demand Resources
https://blogs.unity3d.com/2015/11/26/mastering-on-demand-resources-for-apple-platforms/?_ga=2.109275077.1963473183.1520374571-31786405.1516487702

https://developer.apple.com/library/content/documentation/ServicesDiscovery/Conceptual/GameControllerPG/Introduction/Introduction.html

https://www.howtogeek.com/242223/how-to-use-a-physical-game-controller-with-an-iphone-ipad-or-android-device/

https://www.engadget.com/2014/04/17/10-ios-games-that-are-10-times-better-with-an-mfi-controller/

http://www.techpreview.org/connect-xbox-one-controller-to-your-iphone/978/