Skip to main content

Building to Mobile - Unity



This article will walk you through building your Skillz Unity project to Android and iOS.

1. Configure Game for Skillz

Select the Skillz > Settings menu item to bring up the Skillz Settings window:

Set your Game ID, the environment (Sandbox or Production), and the orientation for your game.

note

Select environment Sandbox for development and testing. Come back here and switch to Production when readying the build for publishing to the app stores.

caution

Please ensure to select the correct orientation if you plan to distribute your game on Android. This setting is important for ensuring your game renders in the correct orientation for gameplay. For instance, if the scene for your main menu is designed for Portrait mode, but your game scene is designed for Landscape, the orientation setting should be set to Landscape.

Additionally, you can choose if users are allowed to exit the Skillz UI via its sidebar menu.

2. Resolve Dependencies

Configure External Dependency Manager

Skillz for Unity is bundled with the External Dependency Manager plugin. This plugin will resolve transitive dependencies between multiple libraries for iOS. Preliminary configuration is needed:

  1. Select the Assets > External Dependency Manager > iOS Resolver > Settings menu item.
  2. Click the Reset to Defaults button as a precaution.
  3. Click the OK button to save your changes.

Install CocoaPods

The External Dependency Manager can install CocoaPods for you, if it is not already installed:

  1. Select Assets > External Dependency Manager > iOS Resolver > Install Cocoapods
  2. Click OK in the pop-up confirming installation was successful.

If the installation fails see known issue: CocoaPods Installation Fails.

3. Build and Run

Unity Player Configuration

Player Settings

  1. In Unity select File > Build Settings....

  2. In the lower left click Player Settings.... Optimal Resolution1

  3. Select Player from the sidebar and click on the iOS tab.

  4. Under Settings for iOS, expand Resolution and Presentation:

    - Select `Resolution Scaling Mode: Fixed DPI`
    - Set `Target DPI` to `328`

    Optimal Resolution1

  5. Under Settings for iOS, expand Other Settings:

    - Deselect `Metal Write-Only Backbuffer`

    metal backbuffer

    - Deselect `Allow downloads over HTTP (nonsecure)`

    Optimal Resolution1

  6. Close the window. It will automatically save your new settings.

Build Settings

  1. In Unity select File > Build Settings...
  2. If Platform selection is not iOS, select iOS and click Switch Platform.

Initiate Build

  1. Click Build to initiate the build process.
  2. When Prompted, enter a destination to save the XCode project.
  3. When complete, the project can be opened by double-clicking the *.xcworkspace file. Do not open the project using the *.xcodeproj file, as it will not properly initialize the CocoaPod dependencies.
  4. In Xocde, choose a profile for your project, connect an iOS device, then run your project.

if a *.xcworkspace file does not appear, make sure you have Cocoapods installed. If this issue persists, try the workaround in the known Issues Page.

Firebase

If you plan on adding Firebase to your Unity project, we recommend you use Unity Firebase 8.9.0, as it has been tested with the Skillz SDK.