Unity
using UnityEngine;
using System;
using Viveport;
/** Language: C# */
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("Init setup error ...");
// Handle error
}
User.IsReady(IsReadyHandler).
}
private static void IsReadyHandler(int nResult)
{
if (nResult != 0)
{
Viveport.Core.Logger.Log("Platform setup error ...");
// Handle error
}
Viveport.Core.Logger.Log("UserId: " + User.GetUserId());
Viveport.Core.Logger.Log("userName: " + User.GetUserName());
Viveport.Core.Logger.Log("userAvatarUrl: " + User.GetUserAvatarUrl());
// Do more things
}
}