Загрузка PICO Unity OpenXR Integration SDK

This commit is contained in:
2024-12-21 10:28:02 +03:00
parent b2ecc77b2a
commit a2c2504d48
628 changed files with 68895 additions and 2 deletions

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: afee36b1667143e0934e6661984401f6
timeCreated: 1666012942

View File

@ -0,0 +1,21 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
namespace Pico.Platform.Editor
{
public class EditorConf
{
public static int minSdkLevel = 29;
public static string minEditorVersion = "2020";
public static string AppIdMetaDataTag = "pvr.app.id";
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 291ce88e932c4172b3245a1f2e8381a1
timeCreated: 1684329960

View File

@ -0,0 +1,158 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using UnityEditor;
namespace Pico.Platform.Editor
{
/// <summary>
/// Unity Setting Getter and Setter
/// </summary>
public class Gs
{
public static string productName
{
get { return PlayerSettings.productName; }
set { PlayerSettings.productName = value; }
}
public static string packageName
{
get { return PlayerSettings.GetApplicationIdentifier(EditorUserBuildSettings.selectedBuildTargetGroup); }
set { PlayerSettings.SetApplicationIdentifier(EditorUserBuildSettings.selectedBuildTargetGroup, value); }
}
public static BuildTargetGroup buildTargetGroup
{
get { return EditorUserBuildSettings.selectedBuildTargetGroup; }
set
{
EditorUserBuildSettings.selectedBuildTargetGroup = value;
if (value == BuildTargetGroup.Android)
{
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android);
}
}
}
public static BuildTarget buildTarget
{
get { return EditorUserBuildSettings.activeBuildTarget; }
}
public static BuildTarget selectedStandaloneTarget
{
get { return EditorUserBuildSettings.selectedStandaloneTarget; }
set
{
EditorUserBuildSettings.selectedStandaloneTarget = value;
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, value);
}
}
public static AndroidSdkVersions minimumApiLevel
{
get { return PlayerSettings.Android.minSdkVersion; }
set { PlayerSettings.Android.minSdkVersion = value; }
}
public static AndroidSdkVersions targetSdkVersion
{
get { return PlayerSettings.Android.targetSdkVersion; }
set { PlayerSettings.Android.targetSdkVersion = value; }
}
public static string bundleVersion
{
get { return PlayerSettings.bundleVersion; }
set { PlayerSettings.bundleVersion = value; }
}
public static int bundleVersionCode
{
get { return PlayerSettings.Android.bundleVersionCode; }
set { PlayerSettings.Android.bundleVersionCode = value; }
}
public static string keystoreName
{
get { return PlayerSettings.Android.keystoreName; }
set { PlayerSettings.Android.keystoreName = value; }
}
public static string keystorePass
{
get { return PlayerSettings.Android.keystorePass; }
set { PlayerSettings.Android.keystorePass = value; }
}
public static string keyaliasName
{
get { return PlayerSettings.Android.keyaliasName; }
set { PlayerSettings.Android.keyaliasName = value; }
}
public static string keyaliasPass
{
get { return PlayerSettings.Android.keyaliasPass; }
set { PlayerSettings.Android.keyaliasPass = value; }
}
public static bool useCustomKeystore
{
get { return PlayerSettings.Android.useCustomKeystore; }
set { PlayerSettings.Android.useCustomKeystore = value; }
}
public static ScriptingImplementation scriptBackend
{
get { return PlayerSettings.GetScriptingBackend(EditorUserBuildSettings.selectedBuildTargetGroup); }
set
{
PlayerSettings.SetScriptingBackend(EditorUserBuildSettings.selectedBuildTargetGroup, value);
if (value == ScriptingImplementation.Mono2x)
{
//mono only support armv7
targetArchitectures = AndroidArchitecture.ARMv7;
}
else if (value == ScriptingImplementation.IL2CPP)
{
//il2cpp use a reasonable default value
if (targetArchitectures != AndroidArchitecture.ARMv7 && targetArchitectures != AndroidArchitecture.ARM64)
{
targetArchitectures = AndroidArchitecture.ARM64;
}
}
}
}
public static AndroidArchitecture targetArchitectures
{
get { return PlayerSettings.Android.targetArchitectures; }
set { PlayerSettings.Android.targetArchitectures = value; }
}
public static AndroidBuildType androidBuildType
{
get { return EditorUserBuildSettings.androidBuildType; }
set { EditorUserBuildSettings.androidBuildType = value; }
}
public static UIOrientation UIOrientation
{
get { return PlayerSettings.defaultInterfaceOrientation; }
set { PlayerSettings.defaultInterfaceOrientation = value; }
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3273a382b4f040e1b701c1db754ee588
timeCreated: 1672406702

View File

@ -0,0 +1,37 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using UnityEditor;
using UnityEngine;
namespace Pico.Platform.Editor
{
public class Menu
{
[MenuItem("PXR_SDK/Platform Settings")]
public static void ShowNewConfig()
{
PicoSettings window = ScriptableObject.CreateInstance(typeof(PicoSettings)) as PicoSettings;
window.minSize = new Vector2(400, 450);
window.maxSize = new Vector2(400, 450);
window.ShowUtility();
}
[MenuItem("PXR_SDK/PC Debug Settings")]
public static void EditPcConfig()
{
var obj = PcConfigEditor.load();
obj.name = "PC Debug Configuration";
Selection.activeObject = obj;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6dfff384357648919df83f7328a03901
timeCreated: 1666014061

View File

@ -0,0 +1,29 @@
{
"name": "PICO.Platform.Editor",
"references": [
"Unity.XR.PICO.Editor",
"Unity.XR.PICO",
"Unity.XR.Management",
"Unity.XR.Management.Editor",
"PICO.Platform",
"Unity.XR.OpenXR.Features.PICOSupport"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"versionDefines": [
{
"name": "com.unity.xr.management",
"expression": "",
"define": "USING_XR_MANAGEMENT"
},
{
"name": "com.unity.xr.pico",
"expression": "",
"define": "USING_XR_SDK_PICO"
}
]
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0714fd8cd186449494c96cfeaa72dc67
timeCreated: 1666088788

View File

@ -0,0 +1,97 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using Unity.XR.PXR;
using UnityEditor;
using UnityEngine;
namespace Pico.Platform.Editor
{
[CustomEditor(typeof(PXR_PlatformSetting))]
public class PXR_PlatformSettingEditor : UnityEditor.Editor
{
private SerializedProperty deviceSNList;
private void OnEnable()
{
deviceSNList = serializedObject.FindProperty("deviceSN");
}
public override void OnInspectorGUI()
{
var startEntitleCheckTip = "If selected, you will need to enter the APPID that is obtained from" +
" PICO Developer Platform after uploading the app for an entitlement check upon the app launch.";
var startEntitleCheckLabel = new GUIContent("User Entitlement Check[?]", startEntitleCheckTip);
PXR_PlatformSetting.Instance.startTimeEntitlementCheck =
EditorGUILayout.Toggle(startEntitleCheckLabel, PXR_PlatformSetting.Instance.startTimeEntitlementCheck);
if (PXR_PlatformSetting.Instance.startTimeEntitlementCheck)
{
serializedObject.Update();
EditorGUILayout.BeginHorizontal();
GUILayout.Label("App ID ", GUILayout.Width(100));
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
PXR_PlatformSetting.Instance.appID =
EditorGUILayout.TextField(PXR_PlatformSetting.Instance.appID, GUILayout.Width(350.0f));
EditorGUILayout.EndHorizontal();
if (PXR_PlatformSetting.Instance.appID == "")
{
EditorGUILayout.BeginHorizontal(GUILayout.Width(300));
EditorGUILayout.HelpBox("APPID is required for Entitlement Check", UnityEditor.MessageType.Error, true);
EditorGUILayout.EndHorizontal();
}
EditorGUILayout.BeginHorizontal();
GUILayout.Label("The APPID is required to run an Entitlement Check. Create / Find your APPID Here:", GUILayout.Width(500));
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
GUIStyle style = new GUIStyle();
style.normal.textColor = new Color(0, 122f / 255f, 204f / 255f);
if (GUILayout.Button("" + "https://developer.pico-interactive.com/developer/overview", style,
GUILayout.Width(200)))
{
Application.OpenURL("https://developer.pico-interactive.com/developer/overview");
}
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
GUILayout.Label("If you do not need user Entitlement Check, please uncheck it.", GUILayout.Width(500));
EditorGUILayout.EndHorizontal();
serializedObject.ApplyModifiedProperties();
var simulationTip = "If true,Development devices will simulate Entitlement Check," +
"you should enter a valid device SN codes list." +
"The SN code can be obtain in Settings-General-Device serial number or input \"adb devices\" in cmd";
var simulationLabel = new GUIContent("Entitlement Check Simulation [?]", simulationTip);
PXR_PlatformSetting.Instance.entitlementCheckSimulation = EditorGUILayout.Toggle(simulationLabel, PXR_PlatformSetting.Instance.entitlementCheckSimulation);
if (PXR_PlatformSetting.Instance.entitlementCheckSimulation)
{
serializedObject.Update();
EditorGUILayout.PropertyField(deviceSNList, true);
serializedObject.ApplyModifiedProperties();
}
if (GUI.changed)
{
EditorUtility.SetDirty(PXR_PlatformSetting.Instance);
GUI.changed = false;
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d0f9ccd124aeb74489816ba2b80ba94
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,122 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.IO;
using LitJson;
using UnityEditor;
using UnityEngine;
namespace Pico.Platform.Editor
{
/// <summary>
/// Unity Setting Getter and Setter
/// </summary>
public enum Region
{
cn = 0,
i18n = 1,
}
public class PcConfig : ScriptableObject
{
public Region region = Region.cn;
public string accessToken = "";
internal bool hasError = false;
}
[CustomEditor(typeof(PcConfig))]
public class PcConfigEditor : UnityEditor.Editor
{
static string filepath = "Assets/Resources/PicoSdkPCConfig.json";
private static string i18nLink = "https://developer-global.pico-interactive.com/document/unity/pc-end-debugging-tool";
private static string cnLink = "https://developer-cn.pico-interactive.com/document/unity/pc-end-debugging-tool";
public override void OnInspectorGUI()
{
var x = Selection.activeObject as PcConfig;
if (x.hasError)
{
EditorGUILayout.LabelField("Config file error,please check the file");
return;
}
base.OnInspectorGUI();
//Read the document
{
GUILayout.Space(5);
var referenceStyle = new GUIStyle(EditorStyles.label);
referenceStyle.normal.textColor = new Color(0, 122f / 255f, 204f / 255f);
referenceStyle.focused.textColor = new Color(0, 122f / 255f, 204f / 255f);
referenceStyle.hover.textColor = new Color(0, 122f / 255f, 204f / 255f);
if (GUILayout.Button("Read the document", referenceStyle))
{
var link = i18nLink;
if (Application.systemLanguage == SystemLanguage.Chinese || Application.systemLanguage == SystemLanguage.ChineseSimplified || Application.systemLanguage == SystemLanguage.ChineseTraditional)
{
link = cnLink;
}
Application.OpenURL(link);
}
}
this.save();
}
public static PcConfig load()
{
var obj = CreateInstance<PcConfig>();
obj.hasError = false;
try
{
if (File.Exists(filepath))
{
var jsonContent = File.ReadAllText(filepath);
var jsonConf = JsonMapper.ToObject(jsonContent);
obj.accessToken = jsonConf["account"]["access_token"].ToString();
if (!Region.TryParse(jsonConf["general"]["region"].ToString() ?? "", out obj.region))
{
obj.region = Region.cn;
}
}
}
catch (Exception e)
{
Debug.LogError(e);
obj.hasError = true;
}
return obj;
}
public void save()
{
var obj = Selection.activeObject as PcConfig;
if (obj.hasError)
{
return;
}
var conf = new JsonData();
conf["general"] = new JsonData();
conf["account"] = new JsonData();
conf["package"] = new JsonData();
conf["general"]["region"] = obj.region.ToString();
conf["account"]["access_token"] = obj.accessToken.Trim();
conf["package"]["package_name"] = Gs.packageName.Trim();
conf["package"]["package_version_code"] = Gs.bundleVersionCode;
conf["package"]["package_version_name"] = Gs.bundleVersion;
File.WriteAllText(filepath, JsonMapper.ToJson(conf));
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2de2dab76a48474c904742a232922902
timeCreated: 1665473073

View File

@ -0,0 +1,118 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System.Collections.Generic;
using Unity.XR.PXR;
using UnityEditor;
using UnityEditor.XR.Management;
using UnityEditor.XR.Management.Metadata;
using UnityEngine;
using UnityEngine.XR.Management;
namespace Pico.Platform.Editor
{
public class PicoGs
{
public static string appId
{
get { return PXR_PlatformSetting.Instance.appID; }
set
{
PXR_PlatformSetting.Instance.appID = value;
EditorUtility.SetDirty(PXR_PlatformSetting.Instance);
}
}
public static bool useHighlight
{
get { return PXR_PlatformSetting.Instance.useHighlight; }
set
{
PXR_PlatformSetting.Instance.useHighlight = value;
EditorUtility.SetDirty(PXR_PlatformSetting.Instance);
}
}
public static bool enableEntitlementCheck
{
get { return PXR_PlatformSetting.Instance.entitlementCheckSimulation; }
set
{
PXR_PlatformSetting.Instance.entitlementCheckSimulation = value;
EditorUtility.SetDirty(PXR_PlatformSetting.Instance);
}
}
public static List<string> entitlementCheckDeviceList
{
get { return PXR_PlatformSetting.Instance.deviceSN; }
set { PXR_PlatformSetting.Instance.deviceSN = value; }
}
#if USING_XR_SDK_PICO
static XRManagerSettings GetXrSettings()
{
XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildTargetGroup.Android);
if (generalSettings == null) return null;
var assignedSettings = generalSettings.AssignedSettings;
return assignedSettings;
}
static PXR_Loader GetPxrLoader()
{
var x = GetXrSettings();
if (x == null) return null;
foreach (var i in x.activeLoaders)
{
if (i is PXR_Loader)
{
return i as PXR_Loader;
}
}
return null;
}
public static bool UsePicoXr
{
get { return GetPxrLoader() != null; }
set
{
var x = GetXrSettings();
if (x == null) return;
var loader = GetPxrLoader();
if (value == false)
{
if (loader == null)
{
}
else
{
x.TryRemoveLoader(loader);
}
}
else
{
if (loader == null)
{
var res = XRPackageMetadataStore.AssignLoader(x, nameof(PXR_Loader), BuildTargetGroup.Android);
Debug.Log($"设置XR{res} {value}");
}
else
{
}
}
}
}
#endif
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b67c9049a1bc4e1c90c2c7b99918f856
timeCreated: 1673612884

View File

@ -0,0 +1,381 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using Unity.XR.PXR;
using UnityEditor;
using UnityEngine;
namespace Pico.Platform.Editor
{
public class PicoSettings : EditorWindow
{
enum Language
{
English = 0,
Chinese = 1,
}
private SerializedObject serObj;
private SerializedProperty gosPty;
static Language language = Language.English;
static string[] strAppIdText = {"Paste your App ID here", "请粘贴你的AppID"};
static string[] strAppIdHelpText = {"App ID is the unique identification ID of the PICO Application. Without AppID, you will not be able to use PICO platform feature.", "APP ID 是应用的唯一标识"};
static string[] strBuildSettingText = {"Recommend Settings [?]", "推荐设置"};
static string[] strBuildSettingHelpText = {"Recommended project settings for PXR SDK", "推荐项目设置"};
static string[] strPlatformBuildText = {"Set Platform To Android", "设置目标平台为Android"};
static string[] strUnityVersionLimit = {$"Unity Editor Version ≥ {EditorConf.minEditorVersion}", $"Unity Editor版本不小于{EditorConf.minEditorVersion}"};
static string[] strOrientationBuildText = {"Set Orientation To LandscapeLeft", "设置屏幕方向为水平"};
static string[] strMinApiLevel = {$"Android Min API Level ≥ {EditorConf.minSdkLevel}", $"Android最小API不低于{EditorConf.minSdkLevel}"};
static string[] strIgnoreButtonText = {"Ask me later", "稍后询问"};
static string[] strApplyButtonText = {"Apply", "应用"};
static string[] strHighlightText = {"Use Highlight", "开启高光时刻"};
private class Res
{
public readonly Texture PicoDeveloper;
public string Correct = "✔️";
public string Wrong = "×";
public GUIStyle correctStyle;
public GUIStyle wrongStyle;
public Res()
{
this.PicoDeveloper = Resources.Load<Texture>("PICODeveloper");
correctStyle = new GUIStyle(GUI.skin.label);
correctStyle.normal.textColor = Color.green;
wrongStyle = new GUIStyle();
wrongStyle.normal.textColor = Color.red;
wrongStyle.fontStyle = FontStyle.Bold;
}
}
private Res _R;
private Res R
{
get
{
if (_R != null) return _R;
_R = new Res();
return _R;
}
}
internal enum ConfigStatus
{
Correct,
Wrong,
Fix,
Hide,
}
internal abstract class ConfigField
{
public bool value = true;
public abstract string[] GetText();
public abstract ConfigStatus GetStatus();
public abstract void Fix();
}
internal class ConfigIsAndroid : ConfigField
{
public override string[] GetText()
{
return strPlatformBuildText;
}
public override ConfigStatus GetStatus()
{
return Gs.buildTargetGroup == BuildTargetGroup.Android ? ConfigStatus.Correct : ConfigStatus.Fix;
}
public override void Fix()
{
Gs.buildTargetGroup = BuildTargetGroup.Android;
}
}
internal class ConfigIsLandscapeLeft : ConfigField
{
public override string[] GetText()
{
return strOrientationBuildText;
}
public override ConfigStatus GetStatus()
{
return Gs.UIOrientation == UIOrientation.LandscapeLeft ? ConfigStatus.Correct : ConfigStatus.Fix;
}
public override void Fix()
{
Gs.UIOrientation = UIOrientation.LandscapeLeft;
}
}
internal class ConfigMinApiLevel : ConfigField
{
public override string[] GetText()
{
return strMinApiLevel;
}
public override ConfigStatus GetStatus()
{
return Gs.minimumApiLevel >= (AndroidSdkVersions) EditorConf.minSdkLevel ? ConfigStatus.Correct : ConfigStatus.Fix;
}
public override void Fix()
{
Gs.minimumApiLevel = (AndroidSdkVersions) EditorConf.minSdkLevel;
}
}
internal class ConfigUnityVersion : ConfigField
{
public override string[] GetText()
{
return strUnityVersionLimit;
}
public override ConfigStatus GetStatus()
{
return String.Compare(Application.unityVersion, EditorConf.minEditorVersion, StringComparison.Ordinal) >= 0 ? ConfigStatus.Hide : ConfigStatus.Wrong;
}
public override void Fix()
{
throw new NotImplementedException();
}
}
public static string appId
{
get { return PicoGs.appId; }
set { PicoGs.appId = value; }
}
public static bool useHighlight
{
get { return PicoGs.useHighlight; }
set { PicoGs.useHighlight = value; }
}
bool enableEC
{
get { return PicoGs.enableEntitlementCheck; }
set { PicoGs.enableEntitlementCheck = value; }
}
private ConfigField[] configFields;
private void OnEnable()
{
configFields = new ConfigField[]
{
new ConfigUnityVersion(),
new ConfigIsAndroid(),
new ConfigIsLandscapeLeft(),
new ConfigMinApiLevel(),
};
this.titleContent = new GUIContent("PICO Platform Settings");
language = Language.English;
if (Application.systemLanguage == SystemLanguage.Chinese || Application.systemLanguage == SystemLanguage.ChineseSimplified || Application.systemLanguage == SystemLanguage.ChineseTraditional)
{
language = Language.Chinese;
}
serObj = new SerializedObject(PXR_PlatformSetting.Instance);
gosPty = serObj.FindProperty(nameof(PXR_PlatformSetting.deviceSN));
}
Vector2 scrollPos;
void OnGUI()
{
var frameWidth = 380;
//顶部图片
{
GUIStyle style = new GUIStyle();
style.stretchWidth = true;
style.fixedWidth = 400;
GUILayout.Label(R.PicoDeveloper, style);
}
//顶部中英文选择
{
GUIStyle activeStyle = new GUIStyle();
activeStyle.alignment = TextAnchor.MiddleCenter;
activeStyle.normal.textColor = new Color(0, 122f / 255f, 204f / 255f);
GUIStyle normalStyle = new GUIStyle();
normalStyle.alignment = TextAnchor.MiddleCenter;
normalStyle.normal.textColor = new Color(0.8f, 0.8f, 0.8f);
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("ENGLISH", language == Language.English ? activeStyle : normalStyle, GUILayout.Width(80)))
{
language = Language.English;
}
GUILayout.Label("|", normalStyle, GUILayout.Width(5));
if (GUILayout.Button("中文", language == Language.Chinese ? activeStyle : normalStyle, GUILayout.Width(80)))
{
language = Language.Chinese;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
}
{
GUIStyle style = new GUIStyle();
style.margin = new RectOffset(5, 5, 5, 5);
GUILayout.BeginVertical(style, GUILayout.Width(360));
}
//AppID设置
{
GUILayout.Space(15);
GUILayout.Label(strAppIdText[(int) language]);
appId = EditorGUILayout.TextField(appId, GUILayout.Width(frameWidth));
if (string.IsNullOrWhiteSpace(appId))
{
EditorGUILayout.HelpBox(strAppIdHelpText[(int) language], UnityEditor.MessageType.Warning);
}
GUILayout.Space(20);
if (appId == "")
{
GUI.enabled = false;
enableEC = false;
}
else
{
GUI.enabled = true;
}
}
//Highlight设置
{
EditorGUILayout.BeginHorizontal();
GUILayout.Label(strHighlightText[(int) language]);
useHighlight = EditorGUILayout.Toggle(useHighlight, GUILayout.Width(frameWidth));
EditorGUILayout.EndHorizontal();
}
//Recommend Settings
{
GUILayout.Space(5);
GUILayout.Label(new GUIContent(strBuildSettingText[(int) language], strBuildSettingHelpText[(int) language]));
GUIStyle style = "frameBox";
style.fixedWidth = frameWidth;
EditorGUILayout.BeginVertical(style);
foreach (var field in configFields)
{
var txt = field.GetText()[(int) language];
switch (field.GetStatus())
{
case ConfigStatus.Correct:
{
EditorGUILayout.BeginHorizontal(GUILayout.Width(frameWidth));
EditorGUILayout.LabelField(txt);
EditorGUILayout.LabelField(R.Correct, R.correctStyle);
GUI.enabled = true;
EditorGUILayout.EndHorizontal();
break;
}
case ConfigStatus.Wrong:
{
EditorGUILayout.BeginHorizontal(GUILayout.Width(frameWidth));
EditorGUILayout.LabelField(txt);
EditorGUILayout.LabelField(R.Wrong, R.wrongStyle);
EditorGUILayout.EndHorizontal();
break;
}
case ConfigStatus.Hide:
{
break;
}
case ConfigStatus.Fix:
{
EditorGUILayout.BeginHorizontal(GUILayout.Width(frameWidth));
EditorGUILayout.LabelField(txt);
float originalValue = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 250;
field.value = EditorGUILayout.Toggle(field.value);
EditorGUIUtility.labelWidth = originalValue;
EditorGUILayout.EndHorizontal();
break;
}
default:
{
Debug.LogWarning($"unhandled ConfigStatus {txt} {field.GetStatus()}");
break;
}
}
}
EditorGUILayout.EndVertical();
}
//按钮区域
{
var hasSomethingToFix = false;
foreach (var field in configFields)
{
if (field.GetStatus() == ConfigStatus.Fix && field.value)
{
hasSomethingToFix = true;
break;
}
}
if (hasSomethingToFix)
{
GUILayout.Space(10);
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(strIgnoreButtonText[(int) language], GUILayout.Width(130)))
{
this.Close();
}
GUI.enabled = hasSomethingToFix;
if (GUILayout.Button(strApplyButtonText[(int) language], GUILayout.Width(130)))
{
this.ApplyRecommendConfig();
}
GUI.enabled = true;
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.FlexibleSpace();
}
}
GUILayout.EndVertical();
}
private void ApplyRecommendConfig()
{
foreach (var field in configFields)
{
if (field.GetStatus() == ConfigStatus.Fix && field.value)
{
field.Fix();
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a65a6e7ecd744ea481a2b1ba6c5c7046
timeCreated: 1673080389

View File

@ -0,0 +1,53 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System.IO;
using System.Xml;
using UnityEditor.Android;
using UnityEngine;
namespace Pico.Platform.Editor
{
public class PlatformManifestRewrite : IPostGenerateGradleAndroidProject
{
public int callbackOrder => 9999;
public void OnPostGenerateGradleAndroidProject(string path)
{
var appId = PicoGs.appId;
if (string.IsNullOrWhiteSpace(appId))
{
Debug.Log("appId is ignored");
return;
}
XmlDocument doc = new XmlDocument();
const string androidUri = "http://schemas.android.com/apk/res/android";
var manifestPath = Path.Combine(path, "src/main/AndroidManifest.xml");
doc.Load(manifestPath);
var app = doc.SelectSingleNode("//application");
if (app == null) return;
var appIdNode = doc.CreateElement("meta-data");
appIdNode.SetAttribute("name", androidUri, "pvr.app.id");
appIdNode.SetAttribute("value", androidUri, appId);
app.AppendChild(appIdNode);
var highlightNode = doc.CreateElement("meta-data");
highlightNode.SetAttribute("name", androidUri, "use_record_highlight_feature");
highlightNode.SetAttribute("value", androidUri, PicoGs.useHighlight.ToString());
app.AppendChild(highlightNode);
doc.Save(manifestPath);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5e6569b4f00343d996dd6610d37068ca
timeCreated: 1684327101

View File

@ -0,0 +1,36 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using Unity.XR.PXR;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
namespace Pico.Platform.Editor
{
public class PlatformPreprocessor : IPreprocessBuildWithReport
{
public int callbackOrder
{
get { return 0; }
}
public void OnPreprocessBuild(BuildReport report)
{
string configAppID = PXR_PlatformSetting.Instance.appID.Trim();
if (string.IsNullOrWhiteSpace(configAppID))
{
Debug.LogWarning("appID is not configured");
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c7e99491577614bbbb6c60ad215598f5
timeCreated: 1674209284

View File

@ -0,0 +1,24 @@
{
"name": "PICO.Platform",
"references": [
"Unity.XR.PICO.Editor",
"Unity.XR.PICO",
"Unity.XR.OpenXR.Features.PICOSupport"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"versionDefines": [
{
"name": "com.unity.xr.management",
"expression": "",
"define": "USING_XR_MANAGEMENT"
},
{
"name": "com.unity.xr.pico",
"expression": "",
"define": "USING_XR_SDK_PICO"
}
]
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b98de7ff63394bdca25fc3bdddff73bf
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1ca6f9e5135f74a4f82828799f50674b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5a08de46916f4c7d945890c51c573e75
timeCreated: 1641895563

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: 053826e297721dc4eadf7e0d49aaa1f3
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d5a8b86f7bcafa441992c4d1df3865d1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: 4a36c175065164d49af8cea2a7e6d3dd
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: 2e7e8b3159f494a4e9815f0203c000bc
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: c0c4571a595d7a74eb1d65f357f06216
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: 32890a668409ab44c8e26bb10e4d3ef5
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: d5b1e924fbfc96740bd9328dc73454a7
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
fileFormatVersion: 2
guid: eb8c825afdd496442be59a9e436b95d7
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 0
Exclude Linux64: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: x86_64
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 19ce57614e1645a3a869516378474f5a
timeCreated: 1665494893

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 28bbe9e36b38b43d8a0a007f60c3feb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,55 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Sky
m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BackTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DownTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FrontTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _LeftTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: dd7b66dc618b0124fa442f6e6658768d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RightTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _UpTex:
m_Texture: {fileID: 2800000, guid: d485f7a8b4cddcc469daf84f71b5a7f8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Exposure: 1
- _Rotation: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f5ef92f0b9b738d429be8f6537730b22
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: d485f7a8b4cddcc469daf84f71b5a7f8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,118 @@
using System;
using System.Collections;
using Pico.Platform.Models;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
namespace Pico.Platform.Samples
{
public class SimpleDemo : MonoBehaviour
{
public bool useAsyncInit = true;
public RawImage headImage;
public Text nameText;
public Text logText;
// Start is called before the first frame update
void Start()
{
Log($"UseAsyncInit={useAsyncInit}");
if (useAsyncInit)
{
try
{
CoreService.AsyncInitialize().OnComplete(m =>
{
if (m.IsError)
{
Log($"Async initialize failed: code={m.GetError().Code} message={m.GetError().Message}");
return;
}
if (m.Data != PlatformInitializeResult.Success && m.Data != PlatformInitializeResult.AlreadyInitialized)
{
Log($"Async initialize failed: result={m.Data}");
return;
}
Log("AsyncInitialize Successfully");
EnterDemo();
});
}
catch (Exception e)
{
Log($"Async Initialize Failed:{e}");
return;
}
}
else
{
try
{
CoreService.Initialize();
}
catch (UnityException e)
{
Log($"Init Platform SDK error:{e}");
throw;
}
EnterDemo();
}
}
void EnterDemo()
{
UserService.RequestUserPermissions(new[] {Permissions.UserInfo, Permissions.FriendRelation}).OnComplete(m =>
{
if (m.IsError)
{
Log($"Permission failed code={m.Error.Code} message={m.Error.Message}");
return;
}
Log($"RequestUserPermissions successfully:{String.Join(",", m.Data.AuthorizedPermissions)}");
getUser();
});
}
void getUser()
{
UserService.GetLoggedInUser().OnComplete(m =>
{
if (m.IsError)
{
Debug.Log($"GetLoggedInUser failed:code={m.Error.Code} message={m.Error.Message}");
return;
}
StartCoroutine(DownloadImage(m.Data.ImageUrl, headImage));
nameText.text = m.Data.DisplayName;
Log($"DisplayName={m.Data.DisplayName} UserId={m.Data.ID}");
});
}
IEnumerator DownloadImage(string mediaUrl, RawImage rawImage)
{
UnityWebRequest request = UnityWebRequestTexture.GetTexture(mediaUrl);
yield return request.SendWebRequest();
if (request.responseCode != 200)
{
Log("Load image failed");
}
else
{
rawImage.texture = ((DownloadHandlerTexture) request.downloadHandler).texture;
rawImage.GetComponent<Renderer>().material.mainTexture = ((DownloadHandlerTexture) request.downloadHandler).texture;
}
}
void Log(string s)
{
logText.text = s;
Debug.Log(s);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1b732fc4d5a124b7a9926a3b408165c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bb50d682529fe4733a4f047bbf45f8a0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2388eea5be72a444795537c4eaedef68
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: afc99c2a85af4b79b8d17dadaf00b40e
timeCreated: 1660284708

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d10b07d0efa7915488f7ac6e32eb5eb6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,118 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Pico.Platform
{
public partial class CLIB
{
public static ulong ppf_Achievements_GetProgressByName(string[] names)
{
var namesHandle = new PtrArray(names);
var result = ppf_Achievements_GetProgressByName(namesHandle.a, names.Length);
namesHandle.Free();
return result;
}
public static ulong ppf_Achievements_GetDefinitionsByName(string[] names)
{
var namesHandle = new PtrArray(names);
var result = ppf_Achievements_GetDefinitionsByName(namesHandle.a, names.Length);
namesHandle.Free();
return result;
}
public static ulong ppf_IAP_GetProductsBySKU(string[] names)
{
var namesHandle = new PtrArray(names);
var result = ppf_IAP_GetProductsBySKU(namesHandle.a, names.Length);
namesHandle.Free();
return result;
}
public static ulong ppf_Leaderboard_GetEntriesByIds(string leaderboardName, int pageSize, int pageIdx, LeaderboardStartAt startAt, string[] userIDs)
{
var userIds = new PtrArray(userIDs);
var result = ppf_Leaderboard_GetEntriesByIds(leaderboardName, pageSize, pageIdx, startAt, userIds.a, (uint) userIDs.Length);
userIds.Free();
return result;
}
public static ulong ppf_Challenges_GetEntriesByIds(ulong challengeID, LeaderboardStartAt startAt, string[] userIDs, int pageIdx, int pageSize)
{
var userIds = new PtrArray(userIDs);
var result = ppf_Challenges_GetEntriesByIds(challengeID, startAt, userIds.a, (uint) userIDs.Length, pageIdx, pageSize);
userIds.Free();
return result;
}
public static ulong ppf_Challenges_Invites(ulong challengeID, string[] userIDs)
{
var userIds = new PtrArray(userIDs);
var result = ppf_Challenges_Invites(challengeID, userIds.a, (uint) userIDs.Length);
userIds.Free();
return result;
}
public static ulong ppf_User_RequestUserPermissions(string[] permissions)
{
var ptrs = new PtrArray(permissions);
var result = ppf_User_RequestUserPermissions(ptrs.a, permissions.Length);
ptrs.Free();
return result;
}
public static ulong ppf_User_GetRelations(string[] userIds)
{
var ptrs = new PtrArray(userIds);
var result = ppf_User_GetRelations(ptrs.a, userIds.Length);
ptrs.Free();
return result;
}
public static ulong ppf_Presence_SendInvites(string[] userIDs)
{
var ptrs = new PtrArray(userIDs);
var result = ppf_Presence_SendInvites(ptrs.a, (uint) userIDs.Length);
ptrs.Free();
return result;
}
public static Dictionary<string, string> DataStoreFromNative(IntPtr ppfDataStore)
{
var map = new Dictionary<string, string>();
var size = (int) ppf_DataStore_GetNumKeys(ppfDataStore);
for (var i = 0; i < size; i++)
{
string key = ppf_DataStore_GetKey(ppfDataStore, i);
map[key] = ppf_DataStore_GetValue(ppfDataStore, key);
}
return map;
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int RtcProcessAudioFrameFunction(IntPtr audioFrameHandle);
[DllImport("pxrplatformloader", EntryPoint = "ppf_Rtc_RegisterLocalAudioProcessor", CallingConvention = CallingConvention.Cdecl)]
public static extern void ppf_Rtc_RegisterLocalAudioProcessor(RtcProcessAudioFrameFunction rtcProcessAudioFrameFunction, RtcAudioChannel channel, RtcAudioSampleRate sampleRate);
[DllImport("pxrplatformloader", EntryPoint = "ppf_InitializeAndroid", CallingConvention = CallingConvention.Cdecl)]
public static extern PlatformInitializeResult ppf_InitializeAndroid(string appId, IntPtr activityObj, IntPtr env);
[DllImport("pxrplatformloader", EntryPoint = "ppf_InitializeAndroidAsynchronous", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ppf_InitializeAndroidAsynchronous(string appId, IntPtr activityObj, IntPtr env);
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d8426d258c3f4a19950866175d24fdcf
timeCreated: 1660302689

View File

@ -0,0 +1,171 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace Pico.Platform
{
public class UTF8Marshaller : ICustomMarshaler
{
public void CleanUpManagedData(object ManagedObj)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
=> Marshal.FreeHGlobal(pNativeData);
public int GetNativeDataSize() => -1;
public IntPtr MarshalManagedToNative(object managedObj)
{
if (managedObj == null)
return IntPtr.Zero;
if (!(managedObj is string))
throw new MarshalDirectiveException("UTF8Marshaler must be used on a string.");
return MarshalUtil.StringToPtr((string) managedObj);
}
public object MarshalNativeToManaged(IntPtr str)
{
if (str == IntPtr.Zero)
return null;
return MarshalUtil.PtrToString(str);
}
public static ICustomMarshaler GetInstance(string pstrCookie)
{
if (marshaler == null)
marshaler = new UTF8Marshaller();
return marshaler;
}
private static UTF8Marshaller marshaler;
}
public class PtrManager
{
public IntPtr ptr;
private bool freed = false;
public PtrManager(byte[] a)
{
this.ptr = MarshalUtil.ByteArrayToNative(a);
}
public void Free()
{
if (freed) return;
freed = true;
Marshal.FreeHGlobal(ptr);
}
~PtrManager()
{
this.Free();
}
}
class PtrArray
{
public IntPtr[] a;
private bool freed = false;
public PtrArray(string[] a)
{
if (a == null)
{
a = Array.Empty<string>();
}
this.a = a.Select(x => MarshalUtil.StringToPtr(x)).ToArray();
}
public void Free()
{
if (freed) return;
freed = true;
foreach (var i in a)
{
Marshal.FreeHGlobal(i);
}
}
~PtrArray()
{
this.Free();
}
}
public static class MarshalUtil
{
public static IntPtr StringToPtr(string s)
{
if (s == null) return IntPtr.Zero;
// not null terminated
byte[] strbuf = Encoding.UTF8.GetBytes(s);
IntPtr buffer = Marshal.AllocHGlobal(strbuf.Length + 1);
Marshal.Copy(strbuf, 0, buffer, strbuf.Length);
// write the terminating null
Marshal.WriteByte(buffer + strbuf.Length, 0);
return buffer;
}
public static string PtrToString(IntPtr p)
{
return GetString(Encoding.UTF8, p);
}
public static string GetString(Encoding encoding, IntPtr str)
{
if (str == IntPtr.Zero)
return null;
int byteCount = 0;
if (Equals(encoding, Encoding.UTF32))
{
while (Marshal.ReadInt32(str, byteCount) != 0) byteCount += sizeof(int);
}
else if (Equals(encoding, Encoding.Unicode) || Equals(encoding, Encoding.BigEndianUnicode))
{
while (Marshal.ReadInt16(str, byteCount) != 0) byteCount += sizeof(short);
}
else
{
while (Marshal.ReadByte(str, byteCount) != 0) byteCount += sizeof(byte);
}
var bytes = new byte[byteCount];
Marshal.Copy(str, bytes, 0, byteCount);
return encoding.GetString(bytes);
}
public static byte[] ByteArrayFromNative(IntPtr ptr, uint length)
{
var ans = new byte[length];
Marshal.Copy(ptr, ans, 0, (int) length);
return ans;
}
public static IntPtr ByteArrayToNative(byte[] a)
{
var ptr = Marshal.AllocHGlobal(a.Length);
Marshal.Copy(a, 0, ptr, a.Length);
return ptr;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a97b494aeb644a0f9e1f1dc041b13a4e
timeCreated: 1660145702

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b9532b7f0304176428dc114e63d9533a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,170 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Collections.Concurrent;
using UnityEngine;
namespace Pico.Platform
{
public class Looper
{
private static readonly ConcurrentDictionary<ulong, Delegate> TaskMap = new ConcurrentDictionary<ulong, Delegate>();
private static readonly ConcurrentDictionary<MessageType, Delegate> NotifyMap = new ConcurrentDictionary<MessageType, Delegate>();
public static readonly ConcurrentDictionary<MessageType, MessageParser> MessageParserMap = new ConcurrentDictionary<MessageType, MessageParser>();
public static void ProcessMessages(uint limit = 0)
{
if (limit == 0)
{
while (true)
{
var msg = PopMessage();
if (msg == null)
{
break;
}
dispatchMessage(msg);
}
}
else
{
for (var i = 0; i < limit; ++i)
{
var msg = PopMessage();
if (msg == null)
{
break;
}
dispatchMessage(msg);
}
}
}
public static Message PopMessage()
{
if (!CoreService.Initialized)
{
return null;
}
var handle = CLIB.ppf_PopMessage();
if (handle == IntPtr.Zero)
{
return null;
}
MessageType messageType = CLIB.ppf_Message_GetType(handle);
Message msg = MessageQueue.ParseMessage(handle);
if (msg == null)
{
if (MessageParserMap.TryGetValue(messageType, out MessageParser parser))
{
msg = parser(handle);
}
}
if (msg == null)
{
Debug.LogError($"Cannot parse message type {messageType}");
}
CLIB.ppf_FreeMessage(handle);
return msg;
}
private static void dispatchMessage(Message msg)
{
if (msg.RequestID != 0)
{
// handle task
if (TaskMap.TryGetValue(msg.RequestID, out var handler))
{
try
{
handler.DynamicInvoke(msg);
}
catch (Exception e)
{
Debug.LogError($"dispatchMessage failed {e}");
}
finally
{
TaskMap.TryRemove(msg.RequestID, out handler);
}
}
else
{
Debug.LogError($"No handler for task: requestId={msg.RequestID}, msg.Type = {msg.Type}. You should call `OnComplete()` when use request API.");
}
}
else
{
// handle notification
if (NotifyMap.TryGetValue(msg.Type, out var handler))
{
handler.DynamicInvoke(msg);
}
else
{
//Debug.LogError($"No handler for notification: msg.Type = {msg.Type}");
}
}
}
public static void RegisterTaskHandler(ulong taskId, Delegate handler)
{
if (taskId == 0)
{
Debug.LogError("The task is invalid.");
return;
}
TaskMap[taskId] = handler;
}
public static void RegisterNotifyHandler(MessageType type, Delegate handler)
{
if (handler == null)
{
Debug.LogError("Cannot register null notification handler.");
return;
}
NotifyMap[type] = handler;
}
public static void RegisterMessageParser(MessageType messageType, MessageParser messageParser)
{
if (messageParser == null)
{
Debug.LogError($"invalid message parser for {messageType}");
return;
}
if (MessageParserMap.ContainsKey(messageType))
{
Debug.LogWarning($"Duplicate register of {messageType}");
}
MessageParserMap.TryAdd(messageType, messageParser);
}
public static void Clear()
{
TaskMap.Clear();
NotifyMap.Clear();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 26c0fea4ad144b74f9173e5b4ad26287
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,117 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Collections.Generic;
using Pico.Platform.Models;
namespace Pico.Platform.Models
{
public class Error
{
public readonly int Code;
public readonly string Message;
public Error(int code, string msg)
{
this.Code = code;
this.Message = msg;
}
public Error(IntPtr handle)
{
this.Code = CLIB.ppf_Error_GetCode(handle);
this.Message = CLIB.ppf_Error_GetMessage(handle);
}
public override string ToString()
{
return $"Error(Code={this.Code},Message={this.Message})";
}
}
public class MessageArray<T> : List<T>
{
/**@brief The next page parameter. It's empty when it doesn't has next page.*/
public string NextPageParam;
/**@brief The previous page parameter. It's empty when it doesn't has previous page.*/
public string PreviousPageParam;
public bool HasNextPage => !String.IsNullOrEmpty(NextPageParam);
public bool HasPreviousPage => !String.IsNullOrEmpty(PreviousPageParam);
}
}
namespace Pico.Platform
{
public class Message
{
public delegate void Handler(Message message);
public readonly MessageType Type;
public readonly ulong RequestID;
public readonly Error Error;
public Message(IntPtr msgPointer)
{
Type = CLIB.ppf_Message_GetType(msgPointer);
RequestID = CLIB.ppf_Message_GetRequestID(msgPointer);
if (CLIB.ppf_Message_IsError(msgPointer))
{
Error = new Error(CLIB.ppf_Message_GetError(msgPointer));
}
}
public bool IsError => Error != null && Error.Code != 0;
[Obsolete("Use Error instead")]
public Error GetError()
{
return Error;
}
}
public class Message<T> : Message
{
public new delegate void Handler(Message<T> message);
public readonly T Data;
public delegate T GetDataFromMessage(IntPtr msgPointer);
public Message(IntPtr msgPointer, GetDataFromMessage getData) : base(msgPointer)
{
if (!IsError)
{
Data = getData(msgPointer);
}
}
}
public delegate Message MessageParser(IntPtr ptr);
public static class CommonParsers
{
public static Message StringParser(IntPtr msgPointer)
{
return new Message<string>(msgPointer, ptr => { return CLIB.ppf_Message_GetString(ptr); });
}
public static Message VoidParser(IntPtr msgPointer)
{
return new Message(msgPointer);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 47be01e871da24aba8e67d2bd8b6646c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,923 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using Pico.Platform.Models;
namespace Pico.Platform
{
public class MessageQueue
{
public static Message ParseMessage(IntPtr msgPointer)
{
Message msg = null;
MessageType messageType = CLIB.ppf_Message_GetType(msgPointer);
switch (messageType)
{
case MessageType.PlatformInitializeAndroidAsynchronous:
{
msg = new Message<PlatformInitializeResult>(msgPointer, ptr => { return (PlatformInitializeResult) CLIB.ppf_Message_GetInt32(ptr); });
break;
}
case MessageType.CloudStorage_StartNewBackup:
{
msg = new Message(msgPointer);
break;
}
#region speech
case MessageType.Notification_Speech_OnAsrResult:
{
msg = new Message<AsrResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAsrResult(ptr);
return new AsrResult(obj);
});
break;
}
case MessageType.Notification_Speech_OnSpeechError:
{
msg = new Message<SpeechError>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSpeechError(ptr);
return new SpeechError(obj);
});
break;
}
#endregion
#region Highlight
case MessageType.Highlight_StartSession:
{
msg = new Message<string>(msgPointer, ptr => { return CLIB.ppf_Message_GetString(ptr); });
break;
}
case MessageType.Highlight_CaptureScreen:
{
msg = new Message<CaptureInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetCaptureInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new CaptureInfo(obj);
});
break;
}
case MessageType.Highlight_ListMedia:
{
msg = new Message<SessionMedia>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSessionMedia(ptr);
if (obj == IntPtr.Zero) return null;
return new SessionMedia(obj);
});
break;
}
case MessageType.Highlight_SaveMedia:
case MessageType.Highlight_ShareMedia:
case MessageType.Highlight_StartRecord:
{
msg = new Message(msgPointer);
break;
}
case MessageType.Highlight_StopRecord:
case MessageType.Notification_Highlight_OnRecordStop:
{
msg = new Message<RecordInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRecordInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RecordInfo(obj);
});
break;
}
#endregion
#region compliance
case MessageType.Compliance_DetectSensitive:
{
msg = new Message<DetectSensitiveResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetDetectSensitiveResult(ptr);
if (obj == IntPtr.Zero) return null;
return new DetectSensitiveResult(obj);
});
break;
}
#endregion
#region Sport
case MessageType.Sport_GetSummary:
{
msg = new Message<SportSummary>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSportSummary(ptr);
if (obj == IntPtr.Zero) return null;
return new SportSummary(obj);
});
break;
}
case MessageType.Sport_GetDailySummary:
{
msg = new Message<SportDailySummaryList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSportDailySummaryArray(ptr);
if (obj == IntPtr.Zero) return null;
return new SportDailySummaryList(obj);
});
break;
}
case MessageType.Sport_GetUserInfo:
{
msg = new Message<SportUserInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSportUserInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new SportUserInfo(obj);
});
break;
}
#endregion
#region User
case MessageType.User_EntitlementCheck:
{
msg = new Message<EntitlementCheckResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetEntitlementCheckResult(ptr);
if (obj == IntPtr.Zero) return null;
return new EntitlementCheckResult(obj);
});
break;
}
case MessageType.User_GetAuthorizedPermissions:
case MessageType.User_RequestUserPermissions:
{
msg = new Message<PermissionResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetPermissionResult(ptr);
if (obj == IntPtr.Zero) return null;
return new PermissionResult(obj);
});
break;
}
case MessageType.User_GetLoggedInUserFriendsAndRooms:
{
msg = new Message<UserRoomList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetUserAndRoomArray(ptr);
if (obj == IntPtr.Zero) return null;
var data = new UserRoomList(obj);
return data;
});
break;
}
case MessageType.Presence_GetSentInvites:
{
msg = new Message<ApplicationInviteList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetApplicationInviteArray(ptr);
if (obj == IntPtr.Zero) return null;
var data = new ApplicationInviteList(obj);
return data;
});
break;
}
case MessageType.Presence_SendInvites:
{
msg = new Message<SendInvitesResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSendInvitesResult(ptr);
if (obj == IntPtr.Zero) return null;
var data = new SendInvitesResult(obj);
return data;
});
break;
}
case MessageType.Presence_GetDestinations:
{
msg = new Message<DestinationList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetDestinationArray(ptr);
if (obj == IntPtr.Zero) return null;
var data = new DestinationList(obj);
return data;
});
break;
}
case MessageType.User_GetAccessToken:
case MessageType.User_GetIdToken:
case MessageType.Rtc_GetToken:
case MessageType.Notification_Rtc_OnTokenWillExpire:
case MessageType.Notification_Rtc_OnUserStartAudioCapture:
case MessageType.Notification_Rtc_OnUserStopAudioCapture:
case MessageType.Application_LaunchOtherApp:
case MessageType.Application_LaunchStore:
case MessageType.Notification_Room_InviteAccepted:
case MessageType.Notification_Challenge_LaunchByInvite:
case MessageType.Notification_ApplicationLifecycle_LaunchIntentChanged:
{
msg = new Message<string>(msgPointer, ptr => { return CLIB.ppf_Message_GetString(ptr); });
break;
}
case MessageType.Notification_Presence_JoinIntentReceived:
{
msg = new Message<PresenceJoinIntent>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetPresenceJoinIntent(ptr);
if (obj == IntPtr.Zero) return null;
return new PresenceJoinIntent(obj);
});
break;
}
case MessageType.Application_GetVersion:
{
msg = new Message<ApplicationVersion>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetApplicationVersion(ptr);
if (obj == IntPtr.Zero) return null;
return new ApplicationVersion(obj);
});
break;
}
case MessageType.User_GetLoggedInUser:
case MessageType.User_Get:
{
msg = new Message<User>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetUser(ptr);
if (obj == IntPtr.Zero) return null;
return new User(obj);
});
break;
}
case MessageType.User_GetOrgScopedID:
{
msg = new Message<OrgScopedID>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetOrgScopedID(ptr);
if (obj == IntPtr.Zero) return null;
return new OrgScopedID(obj);
});
break;
}
case MessageType.User_LaunchFriendRequestFlow:
{
msg = new Message<LaunchFriendResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetLaunchFriendRequestFlowResult(ptr);
if (obj == IntPtr.Zero) return null;
return new LaunchFriendResult(obj);
});
break;
}
case MessageType.User_GetLoggedInUserFriends:
case MessageType.Room_GetInvitableUsers2:
case MessageType.Presence_GetInvitableUsers:
{
msg = new Message<UserList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetUserArray(ptr);
if (obj == IntPtr.Zero) return null;
return new UserList(obj);
});
break;
}
case MessageType.User_GetRelations:
{
msg = new Message<UserRelationResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetUserRelationResult(ptr);
if (obj == IntPtr.Zero) return null;
return new UserRelationResult(obj);
});
break;
}
#endregion
#region RTC
case MessageType.Notification_Rtc_OnRoomMessageReceived:
{
msg = new Message<RtcRoomMessageReceived>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcRoomMessageReceived(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcRoomMessageReceived(obj);
});
break;
}
case MessageType.Notification_Rtc_OnUserMessageReceived:
{
msg = new Message<RtcUserMessageReceived>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcUserMessageReceived(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcUserMessageReceived(obj);
});
break;
}
case MessageType.Notification_Rtc_OnRoomMessageSendResult:
case MessageType.Notification_Rtc_OnUserMessageSendResult:
{
msg = new Message<RtcMessageSendResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcMessageSendResult(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcMessageSendResult(obj);
});
break;
}
case MessageType.Notification_Rtc_OnRoomBinaryMessageReceived:
case MessageType.Notification_Rtc_OnUserBinaryMessageReceived:
{
msg = new Message<RtcBinaryMessageReceived>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcBinaryMessageReceived(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcBinaryMessageReceived(obj);
});
break;
}
case MessageType.Notification_Rtc_OnUserPublishScreen:
case MessageType.Notification_Rtc_OnUserPublishStream:
{
msg = new Message<RtcUserPublishInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcUserPublishInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcUserPublishInfo(ptr);
});
break;
}
case MessageType.Notification_Rtc_OnUserUnPublishScreen:
case MessageType.Notification_Rtc_OnUserUnPublishStream:
{
msg = new Message<RtcUserUnPublishInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcUserUnPublishInfo(ptr);
if (obj == IntPtr.Zero)
{
return null;
}
return new RtcUserUnPublishInfo(obj);
});
break;
}
case MessageType.Notification_Rtc_OnStreamSyncInfoReceived:
{
msg = new Message<RtcStreamSyncInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcStreamSyncInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcStreamSyncInfo(obj);
});
break;
}
case MessageType.Notification_Rtc_OnVideoDeviceStateChanged:
{
break;
}
case MessageType.Notification_Rtc_OnRoomError:
{
msg = new Message<RtcRoomError>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcRoomError(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcRoomError(obj);
});
break;
}
case MessageType.Notification_Rtc_OnRoomWarn:
{
msg = new Message<RtcRoomWarn>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcRoomWarn(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcRoomWarn(obj);
});
break;
}
case MessageType.Notification_Rtc_OnConnectionStateChange:
{
msg = new Message<RtcConnectionState>(msgPointer, ptr => { return (RtcConnectionState) CLIB.ppf_Message_GetInt32(ptr); });
break;
}
case MessageType.Notification_Rtc_OnError:
case MessageType.Notification_Rtc_OnWarn:
{
msg = new Message<Int32>(msgPointer, ptr => { return CLIB.ppf_Message_GetInt32(ptr); });
break;
}
case MessageType.Notification_Rtc_OnRoomStats:
{
msg = new Message<RtcRoomStats>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcRoomStats(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcRoomStats(obj);
});
break;
}
case MessageType.Notification_Rtc_OnJoinRoom:
{
msg = new Message<RtcJoinRoomResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcJoinRoomResult(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcJoinRoomResult(obj);
});
break;
}
case MessageType.Notification_Rtc_OnLeaveRoom:
{
msg = new Message<RtcLeaveRoomResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcLeaveRoomResult(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcLeaveRoomResult(obj);
});
break;
}
case MessageType.Notification_Rtc_OnUserLeaveRoom:
{
msg = new Message<RtcUserLeaveInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcUserLeaveInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcUserLeaveInfo(obj);
});
break;
}
case MessageType.Notification_Rtc_OnUserJoinRoom:
{
msg = new Message<RtcUserJoinInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcUserJoinInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcUserJoinInfo(obj);
});
break;
}
case MessageType.Notification_Rtc_OnAudioPlaybackDeviceChanged:
{
msg = new Message<RtcAudioPlaybackDevice>(msgPointer, ptr => { return (RtcAudioPlaybackDevice) CLIB.ppf_Message_GetInt32(ptr); });
break;
}
case MessageType.Notification_Rtc_OnMediaDeviceStateChanged:
{
msg = new Message<RtcMediaDeviceChangeInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcMediaDeviceChangeInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcMediaDeviceChangeInfo(obj);
});
break;
}
case MessageType.Notification_Rtc_OnLocalAudioPropertiesReport:
{
msg = new Message<RtcLocalAudioPropertiesReport>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcLocalAudioPropertiesReport(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcLocalAudioPropertiesReport(obj);
});
break;
}
case MessageType.Notification_Rtc_OnRemoteAudioPropertiesReport:
{
msg = new Message<RtcRemoteAudioPropertiesReport>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcRemoteAudioPropertiesReport(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcRemoteAudioPropertiesReport(obj);
});
break;
}
case MessageType.Notification_Rtc_OnUserMuteAudio:
{
msg = new Message<RtcMuteInfo>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRtcMuteInfo(ptr);
if (obj == IntPtr.Zero) return null;
return new RtcMuteInfo(obj);
});
break;
}
#endregion
#region IAP
case MessageType.IAP_GetViewerPurchases:
{
msg = new Message<PurchaseList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetPurchaseArray(ptr);
if (obj == IntPtr.Zero) return null;
return new PurchaseList(obj);
});
break;
}
case MessageType.IAP_GetSubscriptionStatus:
{
msg = new Message<SubscriptionStatus>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetSubscriptionStatus(ptr);
if (obj == IntPtr.Zero) return null;
return new SubscriptionStatus(obj);
});
break;
}
case MessageType.IAP_LaunchCheckoutFlow:
{
msg = new Message<Purchase>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetPurchase(ptr);
if (obj == IntPtr.Zero) return null;
return new Purchase(obj);
});
break;
}
case MessageType.IAP_GetProductsBySKU:
{
msg = new Message<ProductList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetProductArray(ptr);
if (obj == IntPtr.Zero) return null;
return new ProductList(obj);
});
break;
}
#endregion
#region DLC
case MessageType.AssetFile_DeleteById:
case MessageType.AssetFile_DeleteByName:
{
msg = new Message<AssetFileDeleteResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetFileDeleteResult(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetFileDeleteResult(obj);
});
break;
}
case MessageType.AssetFile_DownloadById:
case MessageType.AssetFile_DownloadByName:
{
msg = new Message<AssetFileDownloadResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetFileDownloadResult(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetFileDownloadResult(obj);
});
break;
}
case MessageType.AssetFile_DownloadCancelById:
case MessageType.AssetFile_DownloadCancelByName:
{
msg = new Message<AssetFileDownloadCancelResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetFileDownloadCancelResult(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetFileDownloadCancelResult(obj);
});
break;
}
case MessageType.AssetFile_GetList:
case MessageType.AssetFile_GetNextAssetDetailsArrayPage:
{
msg = new Message<AssetDetailsList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetDetailsArray(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetDetailsList(obj);
});
break;
}
case MessageType.AssetFile_StatusById:
case MessageType.AssetFile_StatusByName:
{
msg = new Message<AssetStatus>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetStatus(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetStatus(obj);
});
break;
}
case MessageType.Notification_AssetFile_DownloadUpdate:
{
msg = new Message<AssetFileDownloadUpdate>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetFileDownloadUpdate(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetFileDownloadUpdate(obj);
});
break;
}
case MessageType.Notification_AssetFile_DeleteForSafety:
{
msg = new Message<AssetFileDeleteForSafety>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAssetFileDeleteForSafety(ptr);
if (obj == IntPtr.Zero) return null;
return new AssetFileDeleteForSafety(obj);
});
break;
}
#endregion
#region stark game
case MessageType.Matchmaking_Cancel2:
case MessageType.Matchmaking_ReportResultInsecure:
case MessageType.Matchmaking_StartMatch:
case MessageType.Room_LaunchInvitableUserFlow:
case MessageType.Challenges_LaunchInvitableUserFlow:
case MessageType.Room_UpdateOwner:
case MessageType.Notification_MarkAsRead:
case MessageType.Notification_Game_StateReset:
case MessageType.Presence_Clear:
case MessageType.Presence_Set:
case MessageType.IAP_ConsumePurchase:
case MessageType.Presence_LaunchInvitePanel:
case MessageType.Presence_ShareMedia:
{
msg = new Message(msgPointer);
break;
}
case MessageType.Matchmaking_GetAdminSnapshot:
{
msg = new Message<MatchmakingAdminSnapshot>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingAdminSnapshot(ptr);
return new MatchmakingAdminSnapshot(obj);
});
break;
}
case MessageType.Matchmaking_Browse2:
{
msg = new Message<MatchmakingBrowseResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingBrowseResult(ptr);
return new MatchmakingBrowseResult(obj);
});
break;
}
case MessageType.Matchmaking_Browse2CustomPage:
{
msg = new Message<MatchmakingBrowseResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingBrowseCustomPageResult(ptr);
return new MatchmakingBrowseResult(obj);
});
break;
}
case MessageType.Matchmaking_Enqueue2:
case MessageType.Matchmaking_EnqueueRoom2:
{
msg = new Message<MatchmakingEnqueueResult>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingEnqueueResult(ptr);
return new MatchmakingEnqueueResult(obj);
});
break;
}
case MessageType.Matchmaking_CreateAndEnqueueRoom2:
{
msg = new Message<MatchmakingEnqueueResultAndRoom>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingEnqueueResultAndRoom(ptr);
return new MatchmakingEnqueueResultAndRoom(obj);
});
break;
}
case MessageType.Matchmaking_GetStats:
{
msg = new Message<MatchmakingStats>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetMatchmakingStats(ptr);
return new MatchmakingStats(obj);
});
break;
}
case MessageType.Room_GetCurrent:
case MessageType.Room_GetCurrentForUser:
case MessageType.Notification_Room_RoomUpdate:
case MessageType.Room_CreateAndJoinPrivate:
case MessageType.Room_CreateAndJoinPrivate2:
case MessageType.Room_InviteUser:
case MessageType.Room_Join:
case MessageType.Room_Join2:
case MessageType.Room_JoinNamed:
case MessageType.Room_KickUser:
case MessageType.Room_Leave:
case MessageType.Room_SetDescription:
case MessageType.Room_UpdateDataStore:
case MessageType.Room_UpdateMembershipLockStatus:
case MessageType.Room_UpdatePrivateRoomJoinPolicy:
case MessageType.Notification_Matchmaking_MatchFound:
case MessageType.Room_Get:
{
msg = new Message<Room>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRoom(ptr);
return new Room(obj);
});
break;
}
case MessageType.Room_GetModeratedRooms:
case MessageType.Room_GetNamedRooms:
case MessageType.Room_GetNextRoomArrayPage:
{
msg = new Message<RoomList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRoomArray(ptr);
return new RoomList(obj);
});
break;
}
case MessageType.PlatformGameInitializeAsynchronous:
{
msg = new Message<GameInitializeResult>(msgPointer, ptr =>
{
var objHandle = CLIB.ppf_Message_GetPlatformGameInitialize(ptr);
var obj = CLIB.ppf_PlatformGameInitialize_GetResult(objHandle);
return obj;
});
break;
}
case MessageType.Notification_Game_ConnectionEvent:
{
msg = new Message<GameConnectionEvent>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetGameConnectionEvent(ptr);
return obj;
});
break;
}
case MessageType.Notification_Game_RequestFailed:
{
msg = new Message<GameRequestFailedReason>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetGameRequestFailedReason(ptr);
return obj;
});
break;
}
case MessageType.Leaderboard_Get:
case MessageType.Leaderboard_GetNextLeaderboardArrayPage:
{
msg = new Message<LeaderboardList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetLeaderboardArray(ptr);
return new LeaderboardList(obj);
});
break;
}
case MessageType.Leaderboard_GetEntries:
case MessageType.Leaderboard_GetEntriesAfterRank:
case MessageType.Leaderboard_GetEntriesByIds:
case MessageType.Leaderboard_GetNextEntries:
case MessageType.Leaderboard_GetPreviousEntries:
{
msg = new Message<LeaderboardEntryList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetLeaderboardEntryArray(ptr);
return new LeaderboardEntryList(obj);
});
break;
}
case MessageType.Leaderboard_WriteEntry:
case MessageType.Leaderboard_WriteEntryWithSupplementaryMetric:
{
msg = new Message<bool>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetLeaderboardUpdateStatus(ptr);
return CLIB.ppf_LeaderboardUpdateStatus_GetDidUpdate(obj);
});
break;
}
case MessageType.Achievements_GetAllDefinitions:
case MessageType.Achievements_GetDefinitionsByName:
case MessageType.Achievements_GetNextAchievementDefinitionArrayPage:
msg = new Message<AchievementDefinitionList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAchievementDefinitionArray(ptr);
return new AchievementDefinitionList(obj);
});
break;
case MessageType.Achievements_GetAllProgress:
case MessageType.Achievements_GetNextAchievementProgressArrayPage:
case MessageType.Achievements_GetProgressByName:
msg = new Message<AchievementProgressList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAchievementProgressArray(ptr);
return new AchievementProgressList(obj);
});
break;
case MessageType.Achievements_AddCount:
case MessageType.Achievements_AddFields:
case MessageType.Achievements_Unlock:
msg = new Message<AchievementUpdate>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetAchievementUpdate(ptr);
return new AchievementUpdate(obj);
});
break;
case MessageType.Notification_GetNextRoomInviteNotificationArrayPage:
case MessageType.Notification_GetRoomInvites:
{
msg = new Message<RoomInviteNotificationList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetRoomInviteNotificationArray(ptr);
return new RoomInviteNotificationList(obj);
});
break;
}
case MessageType.Challenges_Invite:
case MessageType.Challenges_Get:
case MessageType.Challenges_Join:
case MessageType.Challenges_Leave:
{
msg = new Message<Challenge>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetChallenge(ptr);
return new Challenge(obj);
});
break;
}
case MessageType.Challenges_GetList:
{
msg = new Message<ChallengeList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetChallengeArray(ptr);
return new ChallengeList(obj);
});
break;
}
case MessageType.Challenges_GetEntries:
case MessageType.Challenges_GetEntriesAfterRank:
case MessageType.Challenges_GetEntriesByIds:
{
msg = new Message<ChallengeEntryList>(msgPointer, ptr =>
{
var obj = CLIB.ppf_Message_GetChallengeEntryArray(ptr);
return new ChallengeEntryList(obj);
});
break;
}
#endregion stark game
default:
break;
}
return msg;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fe58099ac2904f4991b8ba3b7810910c
timeCreated: 1666324189

View File

@ -0,0 +1,77 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Unity.XR.PXR
{
#if UNITY_EDITOR
[InitializeOnLoad]
#endif
public sealed class PXR_PlatformSetting : ScriptableObject
{
public enum simulationType
{
Null,
Invalid,
Valid
}
[SerializeField] public bool entitlementCheckSimulation;
[SerializeField] public bool startTimeEntitlementCheck;
[SerializeField] public string appID;
[SerializeField] public bool useHighlight = true;
public List<string> deviceSN = new List<string>();
private static PXR_PlatformSetting instance;
public static PXR_PlatformSetting Instance
{
get
{
if (instance == null)
{
instance = Resources.Load<PXR_PlatformSetting>("PXR_PlatformSetting");
#if UNITY_EDITOR
string path = Application.dataPath + "/Resources";
if (!Directory.Exists(path))
{
AssetDatabase.CreateFolder("Assets", "Resources");
if (instance == null)
{
instance = CreateInstance<PXR_PlatformSetting>();
AssetDatabase.CreateAsset(instance, "Assets/Resources/PXR_PlatformSetting.asset");
}
}
else
{
if (instance == null)
{
instance = CreateInstance<PXR_PlatformSetting>();
AssetDatabase.CreateAsset(instance, "Assets/Resources/PXR_PlatformSetting.asset");
}
}
#endif
}
return instance;
}
set { instance = value; }
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 508edb944d24e574595a91425051a8e4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using UnityEngine;
namespace Pico.Platform.Framework
{
public class Runner : MonoBehaviour
{
public static void RegisterGameObject()
{
var name = "Pico.Platform.Runner";
GameObject g = GameObject.Find(name);
if (g == null)
{
g = new GameObject(name);
}
if (g.GetComponent<Runner>() == null)
{
g.AddComponent<Runner>();
}
}
void Awake()
{
DontDestroyOnLoad(gameObject);
}
void Update()
{
Looper.ProcessMessages();
}
void OnApplicationQuit()
{
Looper.Clear();
if (Application.isEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor)
{
CLIB.ppf_PcUnInitialize();
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 995e5a6d1a26dd847ab40cf7d49cbe44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,97 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System.Threading.Tasks;
using UnityEngine;
namespace Pico.Platform
{
public class Task
{
public readonly ulong TaskId;
public bool HasSetCallback = false;
public Task(ulong taskId)
{
this.TaskId = taskId;
}
public Task OnComplete(Message.Handler handler)
{
if (handler == null)
{
throw new UnityException("call Task.Oncomplete with null handler.");
}
if (HasSetCallback)
{
throw new UnityException("OnComplete() or Async() can call only once time.");
}
HasSetCallback = true;
Looper.RegisterTaskHandler(TaskId, handler);
return this;
}
public System.Threading.Tasks.Task<Message> Async()
{
if (HasSetCallback)
{
throw new UnityException("OnComplete() or Async() can call only once time.");
}
HasSetCallback = true;
TaskCompletionSource<Message> x = new TaskCompletionSource<Message>();
Message.Handler fun = msg => { x.SetResult(msg); };
Looper.RegisterTaskHandler(this.TaskId, fun);
return x.Task;
}
}
public class Task<T> : Task
{
public Task(ulong taskId) : base(taskId)
{
}
public Task<T> OnComplete(Message<T>.Handler handler)
{
if (handler == null)
{
throw new UnityException("call Task.Oncomplete with null handler.");
}
if (HasSetCallback)
{
throw new UnityException("OnComplete() or Async() can call only once time.");
}
HasSetCallback = true;
Looper.RegisterTaskHandler(TaskId, handler);
return this;
}
public new System.Threading.Tasks.Task<Message<T>> Async()
{
if (HasSetCallback)
{
throw new UnityException("OnComplete() or Async() can call only once time.");
}
HasSetCallback = true;
TaskCompletionSource<Message<T>> x = new TaskCompletionSource<Message<T>>();
Message<T>.Handler fun = msg => { x.SetResult(msg); };
Looper.RegisterTaskHandler(this.TaskId, fun);
return x.Task;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ef1d06cfc9dd85546b917ec0d259ff35
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,51 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform
{
public class TimeUtil
{
public static DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
public static int GetUtcSeconds()
{
return DateTimeToSeconds(DateTime.Now);
}
public static long GetUtcMilliSeconds()
{
return DateTimeToMilliSeconds(DateTime.Now);
}
public static int DateTimeToSeconds(DateTime t)
{
return (int) (t.ToUniversalTime() - UnixEpoch).TotalSeconds;
}
public static long DateTimeToMilliSeconds(DateTime t)
{
return (long) (t.ToUniversalTime() - UnixEpoch).TotalMilliseconds;
}
public static DateTime MilliSecondsToDateTime(long milliSeconds)
{
return UnixEpoch.AddMilliseconds(milliSeconds).ToLocalTime();
}
public static DateTime SecondsToDateTime(long seconds)
{
return UnixEpoch.AddSeconds(seconds).ToLocalTime();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9526d9f6bdb74495807e3f0f81ca6b86
timeCreated: 1659948411

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b0d84e8a0a284315a65f4d42754492a4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,182 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using System.Runtime.InteropServices;
namespace Pico.Platform.Models
{
/// <summary>Achievement update info.</summary>
public class AchievementUpdate
{
/// Whether the achievement is unlocked in this time.
public readonly bool JustUnlocked;
/// Achievement name.
public readonly string Name;
public AchievementUpdate(IntPtr o)
{
JustUnlocked = CLIB.ppf_AchievementUpdate_GetJustUnlocked(o);
Name = CLIB.ppf_AchievementUpdate_GetName(o);
}
}
/// <summary>Achievement info.</summary>
public class AchievementDefinition
{
/// Achievement type.
public readonly AchievementType Type;
/// Achievement name.
public readonly string Name;
/// The target to reach for unlocking a bitfield achievement.
public readonly uint BitfieldLength;
/// The target to reach for unlocking a count achievement.
public readonly long Target;
/// Achievement description.
public readonly string Description;
/// Achievement title.
public readonly string Title;
/// Whether the achievement is archieved.
public readonly bool IsArchived;
/// Whether the achievement is a secret achievement. If so, it can be visible after being unlocked only.
public readonly bool IsSecret;
/// Achievement ID.
public readonly ulong ID;
/// The description shown to users when unlocking the achievement.
public readonly string UnlockedDescription;
/// The write policy of the achievement.
public readonly AchievementWritePolicy WritePolicy;
/// The URL of the image displayed when the achievement is still locked.
public readonly string LockedImageURL;
/// The URL of the image displayed when the achievement is unlocked.
public readonly string UnlockedImageURL;
public AchievementDefinition(IntPtr o)
{
Type = CLIB.ppf_AchievementDefinition_GetType(o);
Name = CLIB.ppf_AchievementDefinition_GetName(o);
BitfieldLength = CLIB.ppf_AchievementDefinition_GetBitfieldLength(o);
Target = CLIB.ppf_AchievementDefinition_GetTarget(o);
Description = CLIB.ppf_AchievementDefinition_GetDescription(o);
Title = CLIB.ppf_AchievementDefinition_GetTitle(o);
IsArchived = CLIB.ppf_AchievementDefinition_IsArchived(o);
IsSecret = CLIB.ppf_AchievementDefinition_IsSecret(o);
ID = CLIB.ppf_AchievementDefinition_GetID(o);
UnlockedDescription = CLIB.ppf_AchievementDefinition_GetUnlockedDescription(o);
WritePolicy = CLIB.ppf_AchievementDefinition_GetWritePolicy(o);
LockedImageURL = CLIB.ppf_AchievementDefinition_GetLockedImageURL(o);
UnlockedImageURL = CLIB.ppf_AchievementDefinition_GetUnlockedImageURL(o);
}
}
/// <summary>Achievement definition list.
/// Each element is \ref AchievementDefinition.
/// </summary>
public class AchievementDefinitionList : MessageArray<AchievementDefinition>
{
/// The total number of `AchievementDefinition`.
public readonly ulong TotalSize;
public AchievementDefinitionList(IntPtr a)
{
TotalSize = (ulong) CLIB.ppf_AchievementDefinitionArray_GetTotalSize(a);
var count = (int) CLIB.ppf_AchievementDefinitionArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new AchievementDefinition(CLIB.ppf_AchievementDefinitionArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AchievementDefinitionArray_HasNextPage(a) ? "true" : string.Empty;
}
}
/// <summary>Achievement progress info. </summary>
public class AchievementProgress
{
/// Achievement ID.
public readonly ulong ID;
/// The progress of a bitfield achievement. `1` represents a completed bit.
public readonly string Bitfield;
/// The progress of a count achievement.
public readonly long Count;
/// Whether the achievement is unlocked
public readonly bool IsUnlocked;
/// Achievement name.
public readonly string Name;
/// The time when the achievement is unlocked.
public readonly DateTime UnlockTime;
/// Additional info, no more than 2KB.
public readonly byte[] ExtraData;
public AchievementProgress(IntPtr o)
{
ID = CLIB.ppf_AchievementProgress_GetID(o);
Bitfield = CLIB.ppf_AchievementProgress_GetBitfield(o);
Count = CLIB.ppf_AchievementProgress_GetCount(o);
IsUnlocked = CLIB.ppf_AchievementProgress_GetIsUnlocked(o);
Name = CLIB.ppf_AchievementProgress_GetName(o);
uint size = CLIB.ppf_AchievementProgress_GetExtraDataLength(o);
ExtraData = new byte[size];
Marshal.Copy(CLIB.ppf_AchievementProgress_GetExtraData(o), ExtraData, 0, (int) size);
var unlockTime = CLIB.ppf_AchievementProgress_GetUnlockTime(o);
if (unlockTime != 0)
{
UnlockTime = TimeUtil.SecondsToDateTime((long) unlockTime);
}
}
}
/// <summary>The list of achievements with their progress info.
/// Each element is \ref AchievementProgress.
/// </summary>
public class AchievementProgressList : MessageArray<AchievementProgress>
{
/// The total number of achievements with progress info.
public readonly ulong TotalSize;
public AchievementProgressList(IntPtr a)
{
TotalSize = (ulong) CLIB.ppf_AchievementProgressArray_GetTotalSize(a);
var count = (int) CLIB.ppf_AchievementProgressArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new AchievementProgress(CLIB.ppf_AchievementProgressArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AchievementProgressArray_HasNextPage(a) ? "true" : string.Empty;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d92845d996c24a5e858d06fe078a5997
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,133 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>App launch details.</summary>
public class LaunchDetails
{
/// How the app was launched:
/// * `Normal`: launched by clicking the app's icon
/// * `RoomInvite`: launched by clicking the room invitation message card
/// * `Deeplink`: launched by clicking the presence invitation message card or calling \ref ApplicationService.LaunchApp
/// * `ChallengeInvite`: launched by clicking the challenge invitation message card
///
public readonly LaunchType LaunchType;
/// Deeplink message. You can pass a deeplink when you call \ref ApplicationService.LaunchApp,
/// and the other app will receive the deeplink.This field will have a value only when `LaunchType` is `LaunchApp`.
public readonly string DeeplinkMessage;
/// Destination API name configured on the PICO Developer Platform.For a presence invitation, the inviters'
/// presence data will contain this field which will be passed when the invitee clicks on the message card.
public readonly string DestinationApiName;
/// The lobby session ID that identifies a group or team.
/// For a presence invitation, the inviters' presence data will contain this field which will be passed
/// when the invitee clicks on the message card.
public readonly string LobbySessionID;
/// The match session ID that identifies a competition.
/// For a presence invitation, the inviters' presence data will contain this field which will be passed when the invitee clicks on the message card.
public readonly string MatchSessionID;
/** The customized extra presence info.
* For a presence invitation, the inviters' presence data will contain this field which will be passed when the invitee clicks on the message card.
* You can use this field to add self-defined presence data. The data size cannot exceed 2MB.
*/
public readonly string Extra;
/// Room ID.For a room invitation, after calling \ref RoomService.InviteUser, this field will be passed when the invitee clicks on the message card.
public readonly UInt64 RoomID;
/// For a challenge invitation, after calling \ref ChallengesService.Invite, this field will be passed when the invitee clicks on the message card.
public readonly UInt64 ChallengeID;
/// Tracking ID.
public readonly string TrackingID;
public LaunchDetails(IntPtr o)
{
DeeplinkMessage = CLIB.ppf_LaunchDetails_GetDeeplinkMessage(o);
DestinationApiName = CLIB.ppf_LaunchDetails_GetDestinationApiName(o);
LobbySessionID = CLIB.ppf_LaunchDetails_GetLobbySessionID(o);
MatchSessionID = CLIB.ppf_LaunchDetails_GetMatchSessionID(o);
Extra = CLIB.ppf_LaunchDetails_GetExtra(o);
RoomID = CLIB.ppf_LaunchDetails_GetRoomID(o);
ChallengeID = CLIB.ppf_LaunchDetails_GetChallengeID(o);
TrackingID = CLIB.ppf_LaunchDetails_GetTrackingID(o);
LaunchType = CLIB.ppf_LaunchDetails_GetLaunchType(o);
}
}
/// <summary>
/// The system information of the device.
/// </summary>
public class SystemInfo
{
/** The current ROM version (i.e., system version) of the device, such as "5.5.0" and "5.6.0".*/
public readonly string ROMVersion;
/** The locale of the device. Locale is combined with language and country code. Such as "zh-CN" and "en-US".*/
public readonly string Locale;
/** The product name of the device, such as "PICO 4".*/
public readonly string ProductName;
/** Whether the device's ROM is CN version. PICO provides different ROM versions in different countries/regions.*/
public readonly bool IsCnDevice;
/** The Matrix's version name. Matrix is a system app which provides system functions for platform services.*/
public readonly string MatrixVersionName;
/** The Matrix's version code. */
public readonly long MatrixVersionCode;
public SystemInfo(IntPtr o)
{
ROMVersion = CLIB.ppf_SystemInfo_GetROMVersion(o);
Locale = CLIB.ppf_SystemInfo_GetLocale(o);
ProductName = CLIB.ppf_SystemInfo_GetProductName(o);
IsCnDevice = CLIB.ppf_SystemInfo_GetIsCnDevice(o);
MatrixVersionName = CLIB.ppf_SystemInfo_GetMatrixVersionName(o);
MatrixVersionCode = CLIB.ppf_SystemInfo_GetMatrixVersionCode(o);
}
}
/// <summary>
/// App's version info.
/// </summary>
public class ApplicationVersion
{
/// The current version code of the installed app.
public readonly long CurrentCode;
/// The current version name of the installed app.
public readonly string CurrentName;
/// The latest version code of the app in the PICO Store.
public readonly long LatestCode;
/// The latest version name of the app in the PICO Store.
public readonly string LatestName;
public ApplicationVersion(IntPtr o)
{
CurrentCode = CLIB.ppf_ApplicationVersion_GetCurrentCode(o);
CurrentName = CLIB.ppf_ApplicationVersion_GetCurrentName(o);
LatestCode = CLIB.ppf_ApplicationVersion_GetLatestCode(o);
LatestName = CLIB.ppf_ApplicationVersion_GetLatestName(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 821a71a2140642259ab07bb49f9ae2c0
timeCreated: 1665579240

View File

@ -0,0 +1,258 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public static class DownloadStatus
{
public const string Downloaded = "downloaded";
public const string Available = "available";
public const string InProgress = "in-progress";
}
/// <summary>
/// Constants indicates whether the user purchased the in-app product.
/// </summary>
public static class IapStatus
{
/// Purchased
public const string Entitled = "entitled";
/// Not purchased.
public const string NotEntitled = "not-entitled";
}
/// <summary> Indicates where the DLC file is displayed.</summary>
public static class AssetType
{
/// The DLC file is displayed in the PICO Store and the app.
public const string Store = "store";
/// The DLC file is displayed in the app only.
public const string Default = "default";
}
public class AssetDetails
{
/// The unique identifier of DLC file.
public ulong AssetId;
/** Some DLC files can be displayed in the PICO Store. Now it has two values: `default` or `store`.
* You can refer to \ref AssetType for details.
*/
public string AssetType;
/// One of `downloaded`, `available`, and `in-progress`. You can refer to \ref DownloadStatus for details.
public string DownloadStatus;
/// The path to the downloaded DLC file. For a non-downloaded DLC file, this field will be empty.
public string Filepath;
/// The meta info of the DLC file.
public string Metadata;
/// The name of the DLC file.
public string Filename;
/// The version of the DLC file.
public int Version;
/// One of `entitled`, `not-entitled`. You can refer to \ref IapStatus for details.
public string IapStatus;
/// The SKU of the in-app product that the DLC file associated with.
public string IapSku;
/// The name of the in-app product that the DLC fiel associated with.
public string IapName;
/// The price of this DLC file.
public string IapPrice;
/// The currency required for purchasing the DLC file.
public string IapCurrency;
/// The description of the in-app product that the DLC file associated with.
public string IapDescription;
/// The icon of the in-app product that the DLC file associated with.
public string IapIcon;
public AssetDetails(IntPtr o)
{
AssetId = CLIB.ppf_AssetDetails_GetAssetId(o);
AssetType = CLIB.ppf_AssetDetails_GetAssetType(o);
DownloadStatus = CLIB.ppf_AssetDetails_GetDownloadStatus(o);
IapStatus = CLIB.ppf_AssetDetails_GetIapStatus(o);
Filepath = CLIB.ppf_AssetDetails_GetFilepath(o);
Metadata = CLIB.ppf_AssetDetails_GetMetadata(o);
Filename = CLIB.ppf_AssetDetails_GetFilename(o);
Version = CLIB.ppf_AssetDetails_GetVersion(o);
IapSku = CLIB.ppf_AssetDetails_GetIapSku(o);
IapName = CLIB.ppf_AssetDetails_GetIapName(o);
IapPrice = CLIB.ppf_AssetDetails_GetIapPrice(o);
IapCurrency = CLIB.ppf_AssetDetails_GetIapCurrency(o);
IapDescription = CLIB.ppf_AssetDetails_GetIapDescription(o);
IapIcon = CLIB.ppf_AssetDetails_GetIapIcon(o);
}
}
/// <summary>
/// Each element is \ref AssetDetails
/// </summary>
public class AssetDetailsList : MessageArray<AssetDetails>
{
public AssetDetailsList(IntPtr a)
{
var count = (int) CLIB.ppf_AssetDetailsArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new AssetDetails(CLIB.ppf_AssetDetailsArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_AssetDetailsArray_GetNextPageParam(a);
}
}
/// <summary>
/// If the downloaded DLC file is different from the original one,
/// the DLC file will be automatically removed, and the app will receive a notification.
/// </summary>
public class AssetFileDeleteForSafety
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The description for why this asset file is deleted.
public readonly string Reason;
public AssetFileDeleteForSafety(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDeleteForSafety_GetAssetId(o);
Reason = CLIB.ppf_AssetFileDeleteForSafety_GetReason(o);
}
}
/// <summary>
/// The callback for \ref AssetFileService.DeleteById and \ref AssetFileService.DeleteByName.
/// </summary>
public class AssetFileDeleteResult
{
/// The path to the DLC file.
public readonly string Filepath;
/// Whether the DLC file is deleted successfully.
public readonly bool Success;
/// The ID of the DLC file.
public readonly ulong AssetId;
public AssetFileDeleteResult(IntPtr o)
{
Filepath = CLIB.ppf_AssetFileDeleteResult_GetFilepath(o);
Success = CLIB.ppf_AssetFileDeleteResult_GetSuccess(o);
AssetId = CLIB.ppf_AssetFileDeleteResult_GetAssetId(o);
}
}
/// <summary>Indicates whether the download of the DLC file is successfully canceled.</summary>
public class AssetFileDownloadCancelResult
{
/// The path to the DLC file.
public readonly string Filepath;
/// Whether the download is successfully canceled.
public readonly bool Success;
/// The ID of the DLC file.
public readonly ulong AssetId;
public AssetFileDownloadCancelResult(IntPtr o)
{
Filepath = CLIB.ppf_AssetFileDownloadCancelResult_GetFilepath(o);
Success = CLIB.ppf_AssetFileDownloadCancelResult_GetSuccess(o);
AssetId = CLIB.ppf_AssetFileDownloadCancelResult_GetAssetId(o);
}
}
/// <summary>The result returned after calling \ref AssetFileService.DownloadById or \ref AssetFileService.DownloadByName.</summary>
public class AssetFileDownloadResult
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The path to the DLC file.
public readonly string Filepath;
public AssetFileDownloadResult(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDownloadResult_GetAssetId(o);
Filepath = CLIB.ppf_AssetFileDownloadResult_GetFilepath(o);
}
}
/// <summary>
/// You will receive this message periodically once you call \ref AssetFileService.DownloadById
/// or \ref AssetFileService.DownloadByName.
/// </summary>
public class AssetFileDownloadUpdate
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The total bytes of the DLC file.
public readonly ulong BytesTotal;
/// The transferred bytes of the DLC file.
public readonly long BytesTransferred;
/// The download status of the DLC file.
public readonly AssetFileDownloadCompleteStatus CompleteStatus;
public AssetFileDownloadUpdate(IntPtr o)
{
AssetId = CLIB.ppf_AssetFileDownloadUpdate_GetAssetId(o);
BytesTotal = CLIB.ppf_AssetFileDownloadUpdate_GetBytesTotal(o);
BytesTransferred = CLIB.ppf_AssetFileDownloadUpdate_GetBytesTransferred(o);
CompleteStatus = CLIB.ppf_AssetFileDownloadUpdate_GetCompleteStatus(o);
}
}
/// <summary>
/// The callback for \ref AssetFileService.StatusById or \ref AssetFileService.StatusByName.
/// </summary>
public class AssetStatus
{
/// The ID of the DLC file.
public readonly ulong AssetId;
/// The name of the DLC file.
public readonly string Filename;
/// The path to the DLC file.
public readonly string Filepath;
/// The download status of the DLC file. You can refer to \ref DownloadStatus for details.
public readonly string DownloadStatus;
public AssetStatus(IntPtr o)
{
AssetId = CLIB.ppf_AssetStatus_GetAssetId(o);
Filename = CLIB.ppf_AssetStatus_GetFilename(o);
Filepath = CLIB.ppf_AssetStatus_GetFilepath(o);
DownloadStatus = CLIB.ppf_AssetStatus_GetDownloadStatus(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fa00ebe2dc4b4ccab93a18d008dece77
timeCreated: 1661769967

View File

@ -0,0 +1,268 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using UnityEngine;
namespace Pico.Platform.Models
{
/// <summary>Challenge setting options.</summary>
public class ChallengeOptions
{
/// For creating challenge options
public ChallengeOptions()
{
Handle = CLIB.ppf_ChallengeOptions_Create();
}
/// Set the end date. Currently, not used.
public void SetEndDate(DateTime value)
{
CLIB.ppf_ChallengeOptions_SetEndDate(Handle, Convert.ToUInt64(TimeUtil.DateTimeToSeconds(value)));
}
/// Set whether to get active challenges.
public void SetIncludeActiveChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludeActiveChallenges(Handle, value);
}
/// Set whether to get future challenges whose start dates are latter than the current time.
public void SetIncludeFutureChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludeFutureChallenges(Handle, value);
}
/// Set whether to get past challenges whose end dates are earlier than the current time.
public void SetIncludePastChallenges(bool value)
{
CLIB.ppf_ChallengeOptions_SetIncludePastChallenges(Handle, value);
}
/// (Optional) Set the name of the leaderboard that the challenges associated with.
public void SetLeaderboardName(string value)
{
CLIB.ppf_ChallengeOptions_SetLeaderboardName(Handle, value);
}
/// Set the start date. Currently, not used.
public void SetStartDate(DateTime value)
{
CLIB.ppf_ChallengeOptions_SetStartDate(Handle, Convert.ToUInt64(TimeUtil.DateTimeToSeconds(value)));
}
/// Set the challenge title. Currently, not used.
public void SetTitle(string value)
{
CLIB.ppf_ChallengeOptions_SetTitle(Handle, value);
}
/// Set the filter for quering specified challenges.
public void SetViewerFilter(ChallengeViewerFilter value)
{
CLIB.ppf_ChallengeOptions_SetViewerFilter(Handle, value);
}
/// Set to get the challenges of a specific visibility type.
public void SetVisibility(ChallengeVisibility value)
{
CLIB.ppf_ChallengeOptions_SetVisibility(Handle, value);
}
public static explicit operator IntPtr(ChallengeOptions options)
{
return options != null ? options.Handle : IntPtr.Zero;
}
~ChallengeOptions()
{
CLIB.ppf_ChallengeOptions_Destroy(Handle);
}
IntPtr Handle;
public IntPtr GetHandle()
{
return Handle;
}
}
/// <summary>Challenge info.</summary>
public class Challenge
{
/// The creator of the challenge.
public readonly ChallengeCreationType CreationType;
/// Challenge ID
public readonly UInt64 ID;
/// Challenge's start date.
public readonly DateTime StartDate;
/// Challenge's end date.
public readonly DateTime EndDate;
/// Participants of the challenge, which might be null. Should check if it is null before use.
public readonly UserList ParticipantsOptional;
/// Users invited to the challenge, which might be null. Should check if it is null before use.
public readonly UserList InvitedUsersOptional;
/// The info about the leaderboard that the challenge associated with.
public readonly Leaderboard Leaderboard;
/// Challenge's title.
public readonly string Title;
/// Challenge's visibility.
public readonly ChallengeVisibility Visibility;
public Challenge(IntPtr o)
{
CreationType = CLIB.ppf_Challenge_GetCreationType(o);
try
{
EndDate = TimeUtil.SecondsToDateTime((long) CLIB.ppf_Challenge_GetEndDate(o));
}
catch (Exception e)
{
Debug.LogWarning($"Challenge Set EndDate: ppf_Challenge_GetEndDate(o) = {CLIB.ppf_Challenge_GetEndDate(o)}, Exception: {e}");
}
ID = CLIB.ppf_Challenge_GetID(o);
{
var pointer = CLIB.ppf_Challenge_GetInvitedUsers(o);
if (pointer == IntPtr.Zero)
{
InvitedUsersOptional = null;
}
else
{
InvitedUsersOptional = new UserList(pointer);
}
}
Leaderboard = new Leaderboard(CLIB.ppf_Challenge_GetLeaderboard(o));
{
var pointer = CLIB.ppf_Challenge_GetParticipants(o);
if (pointer == IntPtr.Zero)
{
ParticipantsOptional = null;
}
else
{
ParticipantsOptional = new UserList(pointer);
}
}
try
{
StartDate = TimeUtil.SecondsToDateTime((long) CLIB.ppf_Challenge_GetStartDate(o));
}
catch (Exception e)
{
Debug.LogWarning($"Challenge Set StartDate: ppf_Challenge_GetStartDate(o) = {CLIB.ppf_Challenge_GetStartDate(o)}, Exception: {e}");
}
Title = CLIB.ppf_Challenge_GetTitle(o);
Visibility = CLIB.ppf_Challenge_GetVisibility(o);
}
}
/// <summary>Challenge list. Each Element is \ref Challenge.</summary>
public class ChallengeList : MessageArray<Challenge>
{
public ChallengeList(IntPtr a)
{
TotalCount = CLIB.ppf_ChallengeArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_ChallengeArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_ChallengeArray_HasPreviousPage(a) ? "true" : String.Empty;
int count = (int) CLIB.ppf_ChallengeArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new Challenge(CLIB.ppf_ChallengeArray_GetElement(a, (UIntPtr) i)));
}
}
/// The total number of challenges in the list.
public readonly ulong TotalCount;
}
/// <summary>Challenge entry info.</summary>
public class ChallengeEntry
{
/// The entry's display score.
public readonly string DisplayScore;
/// The entry's additional info, no more than 2KB.
public readonly byte[] ExtraData;
/// The ID of the challenge that the entry belongs to.
public readonly UInt64 ID;
/// The rank of the entry.
public readonly int Rank;
/// The score of the entry.
public readonly long Score;
/// The time when the entry was written.
public readonly DateTime Timestamp;
/// The user the entry belongs to.
public readonly User User;
public ChallengeEntry(IntPtr o)
{
DisplayScore = CLIB.ppf_ChallengeEntry_GetDisplayScore(o);
var extraDataPtr = CLIB.ppf_ChallengeEntry_GetExtraData(o);
var extraDataSize = CLIB.ppf_ChallengeEntry_GetExtraDataLength(o);
ExtraData = MarshalUtil.ByteArrayFromNative(extraDataPtr, extraDataSize);
ID = CLIB.ppf_ChallengeEntry_GetID(o);
Rank = CLIB.ppf_ChallengeEntry_GetRank(o);
Score = CLIB.ppf_ChallengeEntry_GetScore(o);
try
{
Timestamp = TimeUtil.SecondsToDateTime((long) CLIB.ppf_ChallengeEntry_GetTimestamp(o));
}
catch (Exception e)
{
Debug.LogWarning($"ChallengeEntry Set Timestamp: ppf_ChallengeEntry_GetTimestamp(o) = {CLIB.ppf_ChallengeEntry_GetTimestamp(o)}, Exception: {e}");
}
User = new User(CLIB.ppf_ChallengeEntry_GetUser(o));
}
}
/// <summary>Challenge entry list. Each element is \ref ChallengeEntry.</summary>
public class ChallengeEntryList : MessageArray<ChallengeEntry>
{
public ChallengeEntryList(IntPtr a)
{
TotalCount = CLIB.ppf_ChallengeEntryArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_ChallengeEntryArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_ChallengeEntryArray_HasPreviousPage(a) ? "true" : string.Empty;
int count = (int) CLIB.ppf_ChallengeEntryArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new ChallengeEntry(CLIB.ppf_ChallengeEntryArray_GetElement(a, (UIntPtr) i)));
}
}
/// The total number of entries in the list.
public readonly ulong TotalCount;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e107cf0bdc434409aaf2cf952cc37436
timeCreated: 1664352647

View File

@ -0,0 +1,115 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public class KVPairArray
{
public uint Size { get; private set; }
IntPtr Handle;
public IntPtr GetHandle()
{
return Handle;
}
public KVPairArray(uint size)
{
Size = size;
Handle = CLIB.ppf_KeyValuePairArray_Create((UIntPtr) size);
}
~KVPairArray()
{
CLIB.ppf_KeyValuePairArray_Destroy(Handle);
Handle = IntPtr.Zero;
}
public KVPair GetElement(uint index)
{
return new KVPair(CLIB.ppf_KeyValuePairArray_GetElement(Handle, (UIntPtr) index));
}
}
public class KVPair
{
IntPtr Handle;
bool destroyable = true;
public KVPair()
{
Handle = CLIB.ppf_KeyValuePair_Create();
}
public KVPair(IntPtr o)
{
Handle = o;
destroyable = false;
}
public void SetIntValue(int value)
{
CLIB.ppf_KeyValuePair_SetIntValue(Handle, value);
}
public void SetStringValue(string value)
{
CLIB.ppf_KeyValuePair_SetStringValue(Handle, value);
}
public void SetDoubleValue(double value)
{
CLIB.ppf_KeyValuePair_SetDoubleValue(Handle, value);
}
public int GetIntValue()
{
return CLIB.ppf_KeyValuePair_GetIntValue(Handle);
}
public string GetStringValue()
{
return CLIB.ppf_KeyValuePair_GetStringValue(Handle);
}
public double GetDoubleValue()
{
return CLIB.ppf_KeyValuePair_GetDoubleValue(Handle);
}
public void SetKey(string key)
{
CLIB.ppf_KeyValuePair_SetKey(Handle, key);
}
public string GetKey()
{
return CLIB.ppf_KeyValuePair_GetKey(Handle);
}
public KVPairType GetValueType()
{
return (KVPairType) CLIB.ppf_KeyValuePair_GetValueType(Handle);
}
~KVPair()
{
if (destroyable)
{
CLIB.ppf_KeyValuePair_Destroy(Handle);
Handle = IntPtr.Zero;
}
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: af96c3f14f761724db9f93a693fbad2e
timeCreated: 1523486800
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
public class DetectSensitiveResult
{
/// The filtered text is a string which replace sensitive words with `*`.
public readonly string FilteredText;
/// The proposed strategy to handle user operation.
public readonly SensitiveProposal Proposal;
public DetectSensitiveResult(IntPtr o)
{
FilteredText = CLIB.ppf_DetectSensitiveResult_GetFilteredText(o);
Proposal = CLIB.ppf_DetectSensitiveResult_GetProposal(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3b2e5ad6aabe48df833647b8ce43f0b3
timeCreated: 1679567051

View File

@ -0,0 +1,110 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// Information about screen capturing.
/// </summary>
public class CaptureInfo
{
/// <summary>
/// The path where the image is located.
/// </summary>
public readonly string ImagePath;
/// <summary>
/// The ID of the screen-capturing task.
/// </summary>
public readonly string JobId;
public CaptureInfo(IntPtr o)
{
ImagePath = CLIB.ppf_CaptureInfo_GetImagePath(o);
JobId = CLIB.ppf_CaptureInfo_GetJobId(o);
}
}
/// <summary>
/// Information about screen recording.
/// </summary>
public class RecordInfo
{
/// <summary>
/// The path where the video is located.
/// </summary>
public readonly string VideoPath;
/// <summary>
/// The duration of the video. Unit: milliseconds.
/// </summary>
public readonly int DurationInMilliSeconds;
/// <summary>
/// The width of the video.
/// </summary>
public readonly int Width;
/// <summary>
/// The height of the video.
/// </summary>
public readonly int Height;
/// <summary>
/// The ID of the screen-recording task.
/// </summary>
public readonly string JobId;
public RecordInfo(IntPtr o)
{
VideoPath = CLIB.ppf_RecordInfo_GetVideoPath(o);
DurationInMilliSeconds = CLIB.ppf_RecordInfo_GetDurationInMilliSeconds(o);
Width = CLIB.ppf_RecordInfo_GetWidth(o);
Height = CLIB.ppf_RecordInfo_GetHeight(o);
JobId = CLIB.ppf_RecordInfo_GetJobId(o);
}
}
/// <summary>
/// Information about the images captured and videos recorded in a session.
/// </summary>
public class SessionMedia
{
/// <summary>
/// Image information, including image paths and job IDs.
/// </summary>
public readonly CaptureInfo[] Images;
/// <summary>
/// Video information, including video paths, video durations, video sizes, and job IDs.
/// </summary>
public readonly RecordInfo[] Videos;
public SessionMedia(IntPtr o)
{
{
int sz = (int) CLIB.ppf_SessionMedia_GetImagesSize(o);
Images = new CaptureInfo[sz];
for (int i = 0; i < sz; i++)
{
Images[i] = new CaptureInfo(CLIB.ppf_SessionMedia_GetImages(o, (UIntPtr) i));
}
}
{
int sz = (int) CLIB.ppf_SessionMedia_GetVideosSize(o);
Videos = new RecordInfo[sz];
for (int i = 0; i < sz; i++)
{
Videos[i] = new RecordInfo(CLIB.ppf_SessionMedia_GetVideos(o, (UIntPtr) i));
}
}
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6effacd11a404d7983207e0418286b47
timeCreated: 1686138789

View File

@ -0,0 +1,225 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// The add-on that can be purchased in the app.
///
/// You can create in-app products on the PICO Developer Platform.
/// </summary>
public class Product
{
/// The description of the add-on.
public readonly string Description;
/// The detailed description of the add-on.
public readonly string DetailDescription;
/// The price of the add-on, which is a number string.
public readonly string Price;
/// The currency required for purchasing the add-on.
public readonly string Currency;
/// The name of the add-on.
public readonly string Name;
/// The unique identifier of the add-on.
public readonly string SKU;
/// The icon of the add-on, which is an image URL.
public readonly string Icon;
/// The type of the add-on
public readonly AddonsType AddonsType;
/// The period type for the subscription add-on. Only valid when it's a subscription add-on.
public readonly PeriodType PeriodType;
/// The trial period unit for the subscription add-on. Only valid when it's a subscription add-on.
public readonly PeriodType TrialPeriodUnit;
/// The trial period value for the subscription add-on. Only valid when it's a subscription add-on.
public readonly int TrialPeriodValue;
/// The original price of the add-on, which means the price without discount.
public readonly string OriginalPrice;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// Whether the subscription is auto renewed. Only valid when it's a subscription add-on.
public readonly bool IsContinuous;
public Product(IntPtr o)
{
Description = CLIB.ppf_Product_GetDescription(o);
DetailDescription = CLIB.ppf_Product_GetDetailDescription(o);
Price = CLIB.ppf_Product_GetPrice(o);
Currency = CLIB.ppf_Product_GetCurrency(o);
Name = CLIB.ppf_Product_GetName(o);
SKU = CLIB.ppf_Product_GetSKU(o);
Icon = CLIB.ppf_Product_GetIcon(o);
AddonsType = CLIB.ppf_Product_GetAddonsType(o);
PeriodType = CLIB.ppf_Product_GetPeriodType(o);
TrialPeriodUnit = CLIB.ppf_Product_GetTrialPeriodUnit(o);
TrialPeriodValue = CLIB.ppf_Product_GetTrialPeriodValue(o);
OuterId = CLIB.ppf_Product_GetOuterId(o);
OriginalPrice = CLIB.ppf_Product_GetOriginalPrice(o);
IsContinuous = CLIB.ppf_Product_IsContinuous(o);
}
}
/// <summary>
/// Each element is \ref Product.
/// </summary>
public class ProductList : MessageArray<Product>
{
public ProductList(IntPtr a)
{
var count = (int) CLIB.ppf_ProductArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Product(CLIB.ppf_ProductArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_ProductArray_GetNextPageParam(a);
}
}
/// <summary>
/// The add-on that the current user has purchased.
/// </summary>
public class Purchase
{
/// The expiration time. Only valid when it's a subscription add-on.
public readonly DateTime ExpirationTime;
/// The grant time. Only valid when it's a subscription add-on.
public readonly DateTime GrantTime;
/// The ID of the purchase order.
public readonly string ID;
/// The unique identifier of the add-on in the purchase order.
public readonly string SKU;
/// The icon of the add-on.
public readonly string Icon;
/// The type of the purchased add-on.
public readonly AddonsType AddonsType;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// The current period type of subscription. Only valid when it's a subscription add-on.
public readonly PeriodType CurrentPeriodType;
/// The next period type of subscription. Only valid when it's a subscription add-on.
public readonly PeriodType NextPeriodType;
/// The next pay time of subscription. Only valid when it's a subscription add-on.
public readonly DateTime NextPayTime;
/// The discount info of the purchase.
public readonly DiscountType DiscountType;
/// The comment for the order. Developers can add order comment to a purchase. See also: \ref IAPService.LaunchCheckoutFlow3
public readonly string OrderComment;
public Purchase(IntPtr o)
{
ExpirationTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetExpirationTime(o));
GrantTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetGrantTime(o));
ID = CLIB.ppf_Purchase_GetID(o);
SKU = CLIB.ppf_Purchase_GetSKU(o);
Icon = CLIB.ppf_Purchase_GetIcon(o);
AddonsType = CLIB.ppf_Purchase_GetAddonsType(o);
OuterId = CLIB.ppf_Purchase_GetOuterId(o);
CurrentPeriodType = CLIB.ppf_Purchase_GetCurrentPeriodType(o);
NextPeriodType = CLIB.ppf_Purchase_GetNextPeriodType(o);
NextPayTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_Purchase_GetNextPayTime(o));
DiscountType = CLIB.ppf_Purchase_GetDiscountType(o);
OrderComment = CLIB.ppf_Purchase_GetOrderComment(o);
}
}
/// <summary>
/// Each element is \ref Purchase.
/// </summary>
public class PurchaseList : MessageArray<Purchase>
{
public PurchaseList(IntPtr a)
{
var count = (int) CLIB.ppf_PurchaseArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Purchase(CLIB.ppf_PurchaseArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_PurchaseArray_GetNextPageParam(a);
}
}
/// <summary>
/// \ref IAPService.GetSubscriptionStatus returns the subscription status of a subscription add-on.
/// </summary>
public class SubscriptionStatus
{
/// The SKU of the add-on. SKU is the add-on's unique identifier.
public readonly string SKU;
/// The order ID of the subscription. Only valid when it's a subscription add-on.
public readonly string OuterId;
/// The start time of the subscription.
public readonly DateTime StartTime;
/// The end time of the subscription.
public readonly DateTime EndTime;
/// The period type of the subscription.
public readonly PeriodType PeriodType;
/// The entitlement status of the add-on, which indicates whether the user is entitled to use the add-on.
public readonly EntitlementStatus EntitlementStatus;
/// If `EntitlementStatus` is `Cancel`, `CancelReason` indicates why the subscription has been canceled.
public readonly CancelReason CancelReason;
/// Whether the subscription is in free trial.
public readonly bool IsFreeTrial;
/// The next period of the subscription.
public readonly int NextPeriod;
public SubscriptionStatus(IntPtr o)
{
SKU = CLIB.ppf_SubscriptionStatus_GetSKU(o);
OuterId = CLIB.ppf_SubscriptionStatus_GetOuterId(o);
StartTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SubscriptionStatus_GetStartTime(o));
EndTime = TimeUtil.MilliSecondsToDateTime(CLIB.ppf_SubscriptionStatus_GetEndTime(o));
PeriodType = CLIB.ppf_SubscriptionStatus_GetPeriodType(o);
EntitlementStatus = CLIB.ppf_SubscriptionStatus_GetEntitlementStatus(o);
CancelReason = CLIB.ppf_SubscriptionStatus_GetCancelReason(o);
IsFreeTrial = CLIB.ppf_SubscriptionStatus_GetIsFreeTrial(o);
NextPeriod = CLIB.ppf_SubscriptionStatus_GetNextPeriod(o);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2178942333fc436ab70032c2073b63bb
timeCreated: 1655278125

View File

@ -0,0 +1,146 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>Leaderboard info.</summary>
public class Leaderboard
{
/// The unique identifier of the leaderboard, which is configured on the PICO Developer Platform.
public readonly string ApiName;
/// Leaderboard ID.
public readonly ulong ID;
/** Associate a destination to the leaderboard so that users can be directed to a specific location in the app.
* If the leaderboard for that challenge is associated with a destination, the app will be launched, and the user will be directed to the destination.
* If the leaderboard for that challenge is not associated with any destination, the app will be launched, and the user will be directed to the Home page.
*/
public readonly Destination DestinationOptional;
public Leaderboard(IntPtr o)
{
ApiName = CLIB.ppf_Leaderboard_GetApiName(o);
ID = CLIB.ppf_Leaderboard_GetID(o);
var pointer = CLIB.ppf_Leaderboard_GetDestination(o);
if (pointer == IntPtr.Zero)
DestinationOptional = null;
else
DestinationOptional = new Destination(pointer);
}
}
/// <summary>Leaderboard list. Each element is \ref Leaderboard.</summary>
public class LeaderboardList : MessageArray<Leaderboard>
{
/// The total number of leaderboards in the list.
public readonly ulong TotalCount;
public LeaderboardList(IntPtr a)
{
TotalCount = CLIB.ppf_LeaderboardArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_LeaderboardArray_HasNextPage(a) ? "true" : string.Empty;
var count = (int) CLIB.ppf_LeaderboardArray_GetSize(a);
this.Capacity = count;
for (var i = 0; i < count; i++)
{
Add(new Leaderboard(CLIB.ppf_LeaderboardArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Supplementary metric.</summary>
public class SupplementaryMetric
{
/// The ID of the supplementary metric.
public readonly UInt64 ID;
/// The value of the supplementary metric.
public readonly long Metric;
public SupplementaryMetric(IntPtr o)
{
ID = CLIB.ppf_SupplementaryMetric_GetID(o);
Metric = CLIB.ppf_SupplementaryMetric_GetMetric(o);
}
}
/// <summary>Leaderboard entry info.</summary>
public class LeaderboardEntry
{
/// The entry's display score.
public readonly string DisplayScore;
/// Additional info, no more than 2KB.
public readonly byte[] ExtraData;
/// Entry ID.
public readonly UInt64 ID;
/// The entry's ranking on the leaderboard. For example, returns `1` for top1.
public readonly int Rank;
/// The score used to rank the entry.
public readonly long Score;
/// The supplementary metric used for tiebreakers. This field can be null. Need to check whether it is null before use.
public readonly SupplementaryMetric SupplementaryMetricOptional;
/// The time when the entry was written to the leaderboard.
public readonly DateTime Timestamp;
/// The user the entry belongs to.
public readonly User User;
public LeaderboardEntry(IntPtr o)
{
DisplayScore = CLIB.ppf_LeaderboardEntry_GetDisplayScore(o);
var extraDataPtr = CLIB.ppf_LeaderboardEntry_GetExtraData(o);
var extraDataSize = CLIB.ppf_LeaderboardEntry_GetExtraDataLength(o);
ExtraData = MarshalUtil.ByteArrayFromNative(extraDataPtr, extraDataSize);
ID = CLIB.ppf_LeaderboardEntry_GetID(o);
Rank = CLIB.ppf_LeaderboardEntry_GetRank(o);
Score = CLIB.ppf_LeaderboardEntry_GetScore(o);
Timestamp = TimeUtil.SecondsToDateTime((long) CLIB.ppf_LeaderboardEntry_GetTimestamp(o));
User = new User(CLIB.ppf_LeaderboardEntry_GetUser(o));
{
var pointer = CLIB.ppf_LeaderboardEntry_GetSupplementaryMetric(o);
if (pointer == IntPtr.Zero)
{
SupplementaryMetricOptional = null;
}
else
{
SupplementaryMetricOptional = new SupplementaryMetric(pointer);
}
}
}
}
/// <summary>Leaderboard entry list. Each element is \ref LeaderboardEntry.</summary>
public class LeaderboardEntryList : MessageArray<LeaderboardEntry>
{
/// The total number of entries on the leaderboard.
public readonly ulong TotalCount;
public LeaderboardEntryList(IntPtr a)
{
NextPageParam = CLIB.ppf_LeaderboardEntryArray_HasNextPage(a) ? "true" : string.Empty;
PreviousPageParam = CLIB.ppf_LeaderboardEntryArray_HasPreviousPage(a) ? "true" : string.Empty;
var count = (int) CLIB.ppf_LeaderboardEntryArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new LeaderboardEntry(CLIB.ppf_LeaderboardEntryArray_GetElement(a, (UIntPtr) i)));
}
TotalCount = CLIB.ppf_LeaderboardEntryArray_GetTotalCount(a);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 457e9a7eddbc4d46ab8add0d8ebc03d6
timeCreated: 1655221465

View File

@ -0,0 +1,202 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>Matchmaking admin snapshot. You will receive this after calling \ref MatchmakingService.GetAdminSnapshot.</summary>
public class MatchmakingAdminSnapshot
{
/// List of matchmaking candidates
public readonly MatchmakingAdminSnapshotCandidateList CandidateList;
/// The current matching threshold.
public readonly double MyCurrentThreshold;
public MatchmakingAdminSnapshot(IntPtr o)
{
CandidateList = new MatchmakingAdminSnapshotCandidateList(CLIB.ppf_MatchmakingAdminSnapshot_GetCandidates(o));
MyCurrentThreshold = CLIB.ppf_MatchmakingAdminSnapshot_GetMyCurrentThreshold(o);
}
}
/// <summary>Matchmaking candidate.</summary>
public class MatchmakingAdminSnapshotCandidate
{
/// Whether me and the other user can be matched.
public readonly bool CanMatch;
/// My matching threshold.
public readonly double MyTotalScore;
/// The other user's matching threshold.
public readonly double TheirCurrentThreshold;
public MatchmakingAdminSnapshotCandidate(IntPtr o)
{
CanMatch = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetCanMatch(o);
MyTotalScore = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetMyTotalScore(o);
TheirCurrentThreshold = CLIB.ppf_MatchmakingAdminSnapshotCandidate_GetTheirCurrentThreshold(o);
}
}
/// <summary>
/// Each element is \ref MatchmakingAdminSnapshotCandidate.
/// </summary>
public class MatchmakingAdminSnapshotCandidateList : MessageArray<MatchmakingAdminSnapshotCandidate>
{
/// The total number of MatchmakingAdminSnapshotCandidate in the list.
public readonly ulong TotalCount;
public MatchmakingAdminSnapshotCandidateList(IntPtr a)
{
var count = (int) CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetSize(a);
this.Capacity = count;
TotalCount = (ulong)CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetTotalCount(a);
for (int i = 0; i < count; i++)
{
this.Add(new MatchmakingAdminSnapshotCandidate(CLIB.ppf_MatchmakingAdminSnapshotCandidateArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Matchmaking browse result. You will receive the result after calling \ref MatchmakingService.Browse2. </summary>
public class MatchmakingBrowseResult
{
/// Matchmaking enqueue result.
public readonly MatchmakingEnqueueResult EnqueueResult;
/// The list of matchmaking rooms.
public readonly MatchmakingRoomList MatchmakingRooms;
public MatchmakingBrowseResult(IntPtr o)
{
EnqueueResult = new MatchmakingEnqueueResult(CLIB.ppf_MatchmakingBrowseResult_GetEnqueueResult(o));
MatchmakingRooms = new MatchmakingRoomList(CLIB.ppf_MatchmakingBrowseResult_GetRooms(o));
}
}
/// <summary>Matchmaking enqueue result.</summary>
public class MatchmakingEnqueueResult
{
/// Matchmaking snapshot options. Used for debugging only.
public readonly MatchmakingAdminSnapshot AdminSnapshotOptional;
/// The average waiting time.
public readonly uint AverageWait;
/// The number of matches made in the last hour.
public readonly uint MatchesInLastHourCount;
/// The expected longest waiting time.
public readonly uint MaxExpectedWait;
/// Matchmaking pool name.
public readonly string Pool;
/// Match rate.
public readonly uint RecentMatchPercentage;
public MatchmakingEnqueueResult(IntPtr o)
{
{
var pointer = CLIB.ppf_MatchmakingEnqueueResult_GetAdminSnapshot(o);
if (pointer == IntPtr.Zero)
{
AdminSnapshotOptional = null;
}
else
{
AdminSnapshotOptional = new MatchmakingAdminSnapshot(pointer);
}
}
AverageWait = CLIB.ppf_MatchmakingEnqueueResult_GetAverageWait(o);
MatchesInLastHourCount = CLIB.ppf_MatchmakingEnqueueResult_GetMatchesInLastHourCount(o);
MaxExpectedWait = CLIB.ppf_MatchmakingEnqueueResult_GetMaxExpectedWait(o);
Pool = CLIB.ppf_MatchmakingEnqueueResult_GetPool(o);
RecentMatchPercentage = CLIB.ppf_MatchmakingEnqueueResult_GetRecentMatchPercentage(o);
}
}
/// <summary>Matchmaking enqueue result and room info. You will receive this after calling \ref MatchmakingService.CreateAndEnqueueRoom2.</summary>
public class MatchmakingEnqueueResultAndRoom
{
/// Matchmaking enqueue result.
public readonly MatchmakingEnqueueResult MatchmakingEnqueueResult;
/// Matchmaking room info.
public readonly Room Room;
public MatchmakingEnqueueResultAndRoom(IntPtr o)
{
MatchmakingEnqueueResult = new MatchmakingEnqueueResult(CLIB.ppf_MatchmakingEnqueueResultAndRoom_GetMatchmakingEnqueueResult(o));
Room = new Room(CLIB.ppf_MatchmakingEnqueueResultAndRoom_GetRoom(o));
}
}
/// <summary>Matchmaking room.</summary>
public class MatchmakingRoom
{
/// Room info.
public readonly Models.Room Room;
/// Currently, always `0`.
public readonly uint PingTime;
/// Currently, always `false`.
public readonly bool HasPingTime;
public MatchmakingRoom(IntPtr o)
{
this.PingTime = CLIB.ppf_MatchmakingRoom_GetPingTime(o);
this.Room = new Models.Room(CLIB.ppf_MatchmakingRoom_GetRoom(o));
this.HasPingTime = CLIB.ppf_MatchmakingRoom_HasPingTime(o);
}
}
/**
* Each element is \ref MatchmakingRoom
*/
public class MatchmakingRoomList : MessageArray<MatchmakingRoom>
{
/// The total number.
public readonly int TotalCount;
public MatchmakingRoomList(IntPtr a)
{
TotalCount = CLIB.ppf_MatchmakingRoomArray_GetTotalCount(a);
int count = (int) CLIB.ppf_MatchmakingRoomArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new MatchmakingRoom(CLIB.ppf_MatchmakingRoomArray_GetElement(a, (UIntPtr) i)));
}
}
}
/// <summary>Matchmaking statistics. Will receive this after calling \ref MatchmakingService.GetStats.</summary>
public class MatchmakingStats
{
/// The current user's number of draws.
public readonly uint DrawCount;
/// The current user's number of losses.
public readonly uint LossCount;
/// The current user's skill level for the current matchmaking pool.
public readonly uint SkillLevel;
/// The average of all skill levels for the current matchmaking pool.
public readonly double SkillMean;
/// The standard deviation of all skill levels for the current matchmaking pool
public readonly double SkillStandardDeviation;
/// The current user's number of wins.
public readonly uint WinCount;
public MatchmakingStats(IntPtr o)
{
DrawCount = CLIB.ppf_MatchmakingStats_GetDrawCount(o);
LossCount = CLIB.ppf_MatchmakingStats_GetLossCount(o);
SkillLevel = CLIB.ppf_MatchmakingStats_GetSkillLevel(o);
SkillMean = CLIB.ppf_MatchmakingStats_GetSkillMean(o);
SkillStandardDeviation = CLIB.ppf_MatchmakingStats_GetSkillStandardDeviation(o);
WinCount = CLIB.ppf_MatchmakingStats_GetWinCount(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad76d09e01dbdf749a00f0dfd0ed3c1a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
using UnityEngine;
namespace Pico.Platform.Models
{
/// <summary>
/// Invitation notificiation.
/// </summary>
public class RoomInviteNotification
{
/// Invitation ID.
public readonly UInt64 ID;
/// Room ID.
public readonly UInt64 RoomID;
/// Inviter's user ID.
public readonly string SenderID;
/// The time when the invitation is sent.
public readonly DateTime SentTime;
public RoomInviteNotification(IntPtr o)
{
ID = CLIB.ppf_RoomInviteNotification_GetID(o);
RoomID = CLIB.ppf_RoomInviteNotification_GetRoomID(o);
SenderID = CLIB.ppf_RoomInviteNotification_GetSenderID(o);
SentTime = new DateTime();
try
{
SentTime = TimeUtil.SecondsToDateTime((long) CLIB.ppf_RoomInviteNotification_GetSentTime(o));
}
catch (UnityException ex)
{
Debug.LogWarning($"RoomInviteNotification get SentTime fail {ex}");
throw;
}
}
}
/// <summary>
/// Each element is \ref RoomInviteNotification
/// </summary>
public class RoomInviteNotificationList : MessageArray<RoomInviteNotification>
{
/// The total number.
public readonly int TotalCount;
public RoomInviteNotificationList(IntPtr a)
{
TotalCount = CLIB.ppf_RoomInviteNotificationArray_GetTotalCount(a);
NextPageParam = CLIB.ppf_RoomInviteNotificationArray_HasNextPage(a) ? "true" : string.Empty;
int count = (int) CLIB.ppf_RoomInviteNotificationArray_GetSize(a);
this.Capacity = count;
for (uint i = 0; i < count; i++)
{
this.Add(new RoomInviteNotification(CLIB.ppf_RoomInviteNotificationArray_GetElement(a, (UIntPtr)i)));
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0945c228a6a840e0b4046d70ed08ea25
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,91 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
namespace Pico.Platform.Models
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// The information about the message packet.
/// </summary>
public sealed class Packet : IDisposable
{
/// The size of the message packet.
private readonly ulong size;
/// The handler of the message packet.
private readonly IntPtr handler;
public Packet(IntPtr handler)
{
this.handler = handler;
this.size = (ulong) CLIB.ppf_Packet_GetSize(handler);
}
/// <summary>Get message content.</summary>
public ulong GetBytes(byte[] dest)
{
if ((ulong) dest.LongLength >= size)
{
Marshal.Copy(CLIB.ppf_Packet_GetBytes(handler), dest, 0, (int) size);
return size;
}
else
{
throw new ArgumentException($"Dest array can't hold {size} bytes");
}
}
/// <summary>Get message content.</summary>
public string GetBytes()
{
if (size > 0)
{
byte[] bytes = new byte[size];
Marshal.Copy(CLIB.ppf_Packet_GetBytes(handler), bytes, 0, (int) size);
return System.Text.Encoding.UTF8.GetString(bytes);
}
else
{
return string.Empty;
}
}
/// <summary>Get the ID of the message sender.</summary>
public string SenderId
{
get { return CLIB.ppf_Packet_GetSenderID(handler); }
}
/// <summary>Get message size.</summary>
public ulong Size
{
get { return size; }
}
#region IDisposable
~Packet()
{
Dispose();
}
public void Dispose()
{
CLIB.ppf_Packet_Free(handler);
GC.SuppressFinalize(this);
}
#endregion
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 351ba01c3b9b64a2f99b84ec5e4202b1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,156 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System;
namespace Pico.Platform.Models
{
/// <summary>
/// Destination is a location in the app.
/// You can configure destinations for your app on the PICO Developer Platform.
/// </summary>
public class Destination
{
/// The destination's API name.
public readonly string ApiName;
/// The destination's deeplink message.
public readonly string DeeplinkMessage;
/// The destination's display name.
public readonly string DisplayName;
public Destination(IntPtr o)
{
ApiName = CLIB.ppf_Destination_GetApiName(o);
DeeplinkMessage = CLIB.ppf_Destination_GetDeeplinkMessage(o);
DisplayName = CLIB.ppf_Destination_GetDisplayName(o);
}
}
/// <summary>
/// Each element is \ref Destination
/// </summary>
public class DestinationList : MessageArray<Destination>
{
public DestinationList(IntPtr a)
{
var count = (int) CLIB.ppf_DestinationArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new Destination(CLIB.ppf_DestinationArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_DestinationArray_GetNextPageParam(a);
}
}
/// <summary>
/// App's invitation info.
/// </summary>
public class ApplicationInvite
{
/// The destination where the user is directed to after accepting the invitation.
public readonly Destination Destination;
/// Invited users.
public readonly User Recipient;
/// Invitation ID.
public readonly UInt64 ID;
/// If the user clicks the invitation message, this field will be `true`.
public readonly bool IsActive;
/// The lobby session ID that identifies a group or team.
public readonly string LobbySessionId;
/// The match session ID that identifies a competition.
public readonly string MatchSessionId;
public ApplicationInvite(IntPtr o)
{
Destination = new Destination(CLIB.ppf_ApplicationInvite_GetDestination(o));
Recipient = new User(CLIB.ppf_ApplicationInvite_GetRecipient(o));
ID = CLIB.ppf_ApplicationInvite_GetID(o);
IsActive = CLIB.ppf_ApplicationInvite_GetIsActive(o);
LobbySessionId = CLIB.ppf_ApplicationInvite_GetLobbySessionId(o);
MatchSessionId = CLIB.ppf_ApplicationInvite_GetMatchSessionId(o);
}
}
/// <summary>
/// Each element is \ref ApplicationInvite.
/// </summary>
public class ApplicationInviteList : MessageArray<ApplicationInvite>
{
public ApplicationInviteList(IntPtr a)
{
var count = (int) CLIB.ppf_ApplicationInviteArray_GetSize(a);
this.Capacity = count;
for (int i = 0; i < count; i++)
{
this.Add(new ApplicationInvite(CLIB.ppf_ApplicationInviteArray_GetElement(a, (UIntPtr) i)));
}
NextPageParam = CLIB.ppf_ApplicationInviteArray_GetNextPageParam(a);
}
}
/// <summary>
/// The result returned after calling \ref PresenceService.SendInvites.
/// </summary>
public class SendInvitesResult
{
public readonly ApplicationInviteList Invites;
public SendInvitesResult(IntPtr o)
{
Invites = new ApplicationInviteList(CLIB.ppf_SendInvitesResult_GetInvites(o));
}
}
/// <summary>
/// When user click the invitation message, the app will be launched and you will receive a message with presence info.
/// </summary>
public class PresenceJoinIntent
{
/// The deeplink message of the destination.
public readonly string DeeplinkMessage;
/// The destination api name of the destination.
public readonly string DestinationApiName;
/// The lobby session id which is configured by the sender.
public readonly string LobbySessionId;
/// The match session id which is configured by the sender.
public readonly string MatchSessionId;
/// The extra info of the presence.
public readonly string Extra;
public PresenceJoinIntent(IntPtr o)
{
DeeplinkMessage = CLIB.ppf_PresenceJoinIntent_GetDeeplinkMessage(o);
DestinationApiName = CLIB.ppf_PresenceJoinIntent_GetDestinationApiName(o);
LobbySessionId = CLIB.ppf_PresenceJoinIntent_GetLobbySessionId(o);
MatchSessionId = CLIB.ppf_PresenceJoinIntent_GetMatchSessionId(o);
Extra = CLIB.ppf_PresenceJoinIntent_GetExtra(o);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cefd599deefe0d44294c1b825693cdff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More