Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Unity

using UnityEngine;
using System;
using Viveport;

public class ViveportDemo : MonoBehaviour
{
    static string VIVEPORT_ID = "bd67b286-aafc-449d-8896-bb7e9b351876";

    // Use this for initialization
    void Start ()
    {
        Api.Init(InitStatusHandler, VIVEPORT_ID);
    }

    private static void InitStatusHandler(int nResult)
    {
        Viveport.Core.Logger.Log("Init(): " + nResult);
        if (nResult != 0)
        {
           Viveport.Core.Logger.Log("Platform setup error ...");

           // Handle error
        }

        Viveport.Core.Logger.Log("Version: " + Api.Version());
        Api.QueryRuntimeMode(QueryRunTimeHandler);  // QueryRunMode function
    }

    private static void ShutdownHandler(int nResult)
    {
        Viveport.Core.Logger.Log("Shutdown(): " + nResult);
        if (nResult != 0)
        {
            // Handle error
        }

        // Do something
        // Do more things
    }

    private static void QueryRunTimeHandler(int nResult,int nMode)
    {
        if (nResult == 0)
        {
            Viveport.Core.Logger.Log("QueryRunTimeHandler is successful" + nResult + "Running mode is " + nMode);
            // nMode = 1 (Viveport Desktop mode), nMode = 2 (Viveport Arcade mode)
            if (nMode == 1)
            {
                // Use Viveport API
            }
            else
            {
                // Use Viveport Arcade API
            }
        }
        else
        {
           Viveport.Core.Logger.Log("QueryRunTimeHandler error: " + nResult);
        }
    }
 }