Project Configuration

Last updated: 2020-04-02 18:56:35

    Operation Scenarios

    This document describes how to configure a Unity project for the GME APIs for Unity.

    Downloading SDK

    1. Download the applicable demo and SDK. For more information, please see SDK Download Guide.
    2. Locate the SDK resources for Unity on the page.
    3. Click Download. After decompression, the downloaded SDK resources include the following files:
    File Name Description Role
    Plugins SDK library files Stores library files for each platform
    GMESDK SDK code files Provides APIs

    Project Configuration Steps

    Importing Plugins files

    Copy the files from the Plugins folder in the SDK to the Plugins folder under Assets of your Unity project as shown below:

    If you don't need to export executables in the Win32 architecture, delete the x86 folder under the Plugins folder.

    Importing code files

    Copy the files in the Scripts folder in the SDK to the folder used to store code in your Unity project as shown below:

    Audio settings

    In the Unity editor, go to Edit > Project Settings > Audio and use the default system settings. If you make a change to the settings, Unity playback sound effect will be affected due to the hardware buffer set on the iOS device, as shown below:

    If the settings are as follows, Unity playback sound effect will be interrupted due to the hardware buffer set on the iOS device:

    Operations on macOS

    If you use Unity to access the GME SDK on macOS 10.15.x, an error will be displayed for file corruption during the execution. This error is caused by the com.apple.quarantine attribute, and the most direct solution is to delete this attribute.

    1. Run the cd command in terminal to go to the Unity_OpenSDK_Audio/Assets/Plugins/ folder in the project.
    2. Run the following command:
      $ xattr -d com.apple.quarantine gmesdk.bundle

    This operation is risky. You are recommended to use a lower version of macOS for access.

    Project Export Configuration

    Project configuration is required before you can export executables from the Unity engine for different platforms:

    OS Project Configuration
    Android Android Project Configuration
    iOS iOS Project Configuration
    macOS macOS Project Configuration

    The GME SDK for Unity supports IL2CPP compilation.

    Exporting for iOS

    1. Make sure that your Xcode version is above 10.0. Xcode 11.3 is used here as an example.
    2. If the following error is displayed during compilation, please disable Bitcode.
      To disable this feature, search for Bitcode under Targets > Build Settings and set the corresponding option to NO.
    3. If the following error occurs during compilation, please complete the library files.

      Sample list of library files:

    Exporting for Android

    1. The GME SDK for Unity provides lib files for arm64-v8a, armeabi-v7a, and x86 by default. Please delete unnecessary files as appropriate.
    2. To export an Android executable, you need to configure relevant permissions in AndroidManifest.xml to avoid audio or permission errors. For required permissions, please see Android Project Configuration.
    3. After exporting the executable apk file, if there is a black screen or crash when opening it, it is generally due to the lacking of corresponding architecture lib file, please add or delete it according to the project.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help