docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Test your project in Play mode

    It's possible to test some aspects of your Microsoft GDK based project using the Unity Editors built in Play mode. However, you must first satisfy the following requirements:

    1. Create a valid MicrosoftGame.config that exits alongside the executing process, in this case Unity.exe.
    2. Correctly initialize and uninitialize the Microsoft GDK. Paired API calls must be matched when entering and exiting Play mode.

    Create a valid MicrosoftGame.config

    Before calling SDK.XGameRuntimeInitialize() a valid MicrosoftGame.config file must exist alongside the executing process. In the case of the Unity Editor and its Play mode, this is Unity.exe.

    To achieve this, use the following steps:

    1. Locate the MGC Asset you want to use.
    2. Go to Assets > Show In Explorer.
    3. Copy and paste the .mgc file to the location containing Unity.exe.
    4. Rename the file to MicrosoftGame.config.
    Note

    Changes to the MicrosoftGame.config, after calling SDK.XGameRuntimeInitialize(), won't be picked up and will require an Editor restart. This is a known issue.

    Correctly initialize and uninitialize the Microsoft GDK

    The Microsoft GDK Tools package doesn't initialize or uninitialize the API on your behalf. You must ensure that your script code does this, and that matched pairs are called as expected when entering and exiting the Unity Editor Play mode. Failure to do so might lead to unexpected results or errors whilst testing your project.

    For example, a call to SDK.XGameRuntimeInitialize() must be matched with a subsequent call to SDK.XGameRuntimeUninitialize().

    Neither the Unity Editor or the Microsoft GDK Tools package is able to clean unmatched API calls.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)