上传YomovSDK
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class Intent
|
||||
{
|
||||
private string Componentpkg = "";
|
||||
private string Componentcls = "";
|
||||
private string Action = "";
|
||||
private string type = "";
|
||||
private string url = "";
|
||||
|
||||
List<string> categoryList = new List<string>();
|
||||
Dictionary<string, string> stringPairs = new Dictionary<string, string>();
|
||||
Dictionary<string, bool> boolPairs = new Dictionary<string, bool>();
|
||||
Dictionary<string, int> intPairs = new Dictionary<string, int>();
|
||||
Dictionary<string, float> floatPairs = new Dictionary<string, float>();
|
||||
Dictionary<string, double> doublePairs = new Dictionary<string, double>();
|
||||
|
||||
public void setComponent(string pkg, string cls)
|
||||
{
|
||||
Componentpkg = pkg;
|
||||
Componentcls = cls;
|
||||
}
|
||||
|
||||
public void setAction(string _Action)
|
||||
{
|
||||
Action = _Action;
|
||||
}
|
||||
|
||||
public void setType(string _type)
|
||||
{
|
||||
type = _type;
|
||||
}
|
||||
|
||||
public void setData(string _url)
|
||||
{
|
||||
url = _url;
|
||||
}
|
||||
|
||||
public void addCategory(string _category)
|
||||
{
|
||||
categoryList.Add(_category);
|
||||
}
|
||||
|
||||
public void putExtra(string name, string value)
|
||||
{
|
||||
stringPairs.Add(name, value);
|
||||
}
|
||||
|
||||
public void putExtra(string name, int value)
|
||||
{
|
||||
intPairs.Add(name, value);
|
||||
}
|
||||
|
||||
public void putExtra(string name, float value)
|
||||
{
|
||||
floatPairs.Add(name, value);
|
||||
}
|
||||
|
||||
public void putExtra(string name, double value)
|
||||
{
|
||||
doublePairs.Add(name, value);
|
||||
}
|
||||
|
||||
public void putExtra(string name, bool value)
|
||||
{
|
||||
boolPairs.Add(name, value);
|
||||
}
|
||||
|
||||
public AndroidJavaObject getIntent()
|
||||
{
|
||||
AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent");
|
||||
if (!string.IsNullOrEmpty(Componentpkg) && !string.IsNullOrEmpty(Componentcls))
|
||||
{
|
||||
AndroidJavaObject componentName =
|
||||
new AndroidJavaObject("android.content.ComponentName", Componentpkg, Componentcls);
|
||||
intent.Call<AndroidJavaObject>("setComponent", componentName);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Action))
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("setAction", Action);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(type))
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("setType", type);
|
||||
}
|
||||
|
||||
// mIntent.setData(Uri.parse(""));
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
AndroidJavaClass uriClass = new AndroidJavaClass("android.net.Uri"); // 对应的安卓调用函数是Uri.parse()
|
||||
AndroidJavaObject uriObject = uriClass.CallStatic<AndroidJavaObject>("parse", url);
|
||||
intent.Call<AndroidJavaObject>("setData", uriObject);
|
||||
}
|
||||
|
||||
if (categoryList.Count != 0)
|
||||
{
|
||||
for (int i = 0; i < categoryList.Count; i++)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("addCategory", categoryList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in stringPairs)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("putExtra", kvp.Key, kvp.Value);
|
||||
}
|
||||
foreach (KeyValuePair<string, int> kvp in intPairs)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("putExtra", kvp.Key, kvp.Value);
|
||||
}
|
||||
foreach (KeyValuePair<string, bool> kvp in boolPairs)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("putExtra", kvp.Key, kvp.Value);
|
||||
}
|
||||
foreach (KeyValuePair<string, float> kvp in floatPairs)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("putExtra", kvp.Key, kvp.Value);
|
||||
}
|
||||
foreach (KeyValuePair<string, double> kvp in doublePairs)
|
||||
{
|
||||
intent.Call<AndroidJavaObject>("putExtra", kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
return intent;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f48c296fe3e1837419e57eca0d67f9ba
|
||||
timeCreated: 1709199569
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class LargeSpaceQuickModeInfo
|
||||
{
|
||||
public bool status;
|
||||
public int length;
|
||||
public int width;
|
||||
public int originType;
|
||||
|
||||
public LargeSpaceQuickModeInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return
|
||||
$"{nameof(status)}: {status}, {nameof(length)}: {length}, {nameof(width)}: {width}, {nameof(originType)}: {originType}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc19e14a014e97045bfc817f63c5b40a
|
||||
timeCreated: 1715673498
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class MarkerInfo
|
||||
{
|
||||
// position
|
||||
public double posX;
|
||||
public double posY;
|
||||
public double posZ;
|
||||
|
||||
// rotation
|
||||
public double rotationX;
|
||||
public double rotationY;
|
||||
public double rotationZ;
|
||||
public double rotationW;
|
||||
|
||||
// 标志位:识别无效=0,识别有效=1
|
||||
public int validFlag;
|
||||
|
||||
// 类型:静态=1/动态=0
|
||||
public int markerType;
|
||||
|
||||
// marker id
|
||||
public int iMarkerId;
|
||||
|
||||
// 检测图像的时间戳
|
||||
public double dTimestamp;
|
||||
|
||||
// 预留标志位
|
||||
public float[] reserve;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(posX)}: {posX}, {nameof(posY)}: {posY}, {nameof(posZ)}: {posZ}, {nameof(rotationX)}: {rotationX}, {nameof(rotationY)}: {rotationY}, {nameof(rotationZ)}: {rotationZ}, {nameof(rotationW)}: {rotationW}, {nameof(validFlag)}: {validFlag}, {nameof(markerType)}: {markerType}, {nameof(iMarkerId)}: {iMarkerId}, {nameof(dTimestamp)}: {dTimestamp}, {nameof(reserve)}: {string.Join(" ", reserve)}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5544d34d4e1848a44a4e8d6355f79793
|
||||
timeCreated: 1686224373
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class OffLineSystemUpdateConfig
|
||||
{
|
||||
//OTA压缩包路径
|
||||
public String otaFilePath = null;
|
||||
//升级完成后是否自动重启
|
||||
public Boolean autoReboot = true;
|
||||
//升级过程中是否显示进度
|
||||
public Boolean showProgress = false;
|
||||
public OffLineSystemUpdateConfig()
|
||||
{
|
||||
}
|
||||
|
||||
public OffLineSystemUpdateConfig(string otaFilePath, bool autoReboot, bool showProgress)
|
||||
{
|
||||
this.otaFilePath = otaFilePath;
|
||||
this.autoReboot = autoReboot;
|
||||
this.showProgress = showProgress;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bacf34f0a1d4af78e887965627b33eb
|
||||
timeCreated: 1721372797
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class Point3D
|
||||
{
|
||||
public double x;
|
||||
public double y;
|
||||
public double z;
|
||||
|
||||
public Point3D()
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Point3D:{nameof(x)}: {x}, {nameof(y)}: {y}, {nameof(z)}: {z}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da096e5d03a7cbd4a8f7a6913f71f720
|
||||
timeCreated: 1715150347
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class WifiConfiguration
|
||||
{
|
||||
public WifiConfiguration(string ssid, string password, bool isClient=true)
|
||||
{
|
||||
this.ssid = ssid;
|
||||
this.password = password;
|
||||
this.isClient = isClient;
|
||||
}
|
||||
public WifiConfiguration()
|
||||
{
|
||||
this.ssid = "";
|
||||
this.password = "";
|
||||
this.isClient = true;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{nameof(ssid)}: {ssid}, {nameof(password)}: {password}, {nameof(isClient)}: {isClient}";
|
||||
}
|
||||
|
||||
public string ssid;
|
||||
public string password;
|
||||
public bool isClient;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 125a220e1cca49a38fb1bc398371735b
|
||||
timeCreated: 1727247563
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace Unity.XR.PICO.TOBSupport
|
||||
{
|
||||
public class WifiDisplayModel
|
||||
{
|
||||
public static int STATUS_NOT_CONNECT = -1;
|
||||
public static int STATUS_NONE = 0;
|
||||
public static int STATUS_SCANNING = 1;
|
||||
public static int STATUS_CONNECTING = 2;
|
||||
public static int STATUS_AVAILABLE = 3;
|
||||
public static int STATUS_NOT_AVAILABLE = 4;
|
||||
public static int STATUS_IN_USE = 5;
|
||||
public static int STATUS_CONNECTED = 6;
|
||||
|
||||
public string deviceAddress;
|
||||
public string deviceName;
|
||||
public bool isAvailable;
|
||||
public bool canConnect;
|
||||
public bool isRemembered;
|
||||
public int statusCode;
|
||||
public string status;
|
||||
public string description;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c2f564867a71c5418a7d7e6a44c2173
|
||||
timeCreated: 1686050281
|
||||
Reference in New Issue
Block a user