123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- using NibiruTask;
- using Nxr.Internal;
- using UnityEngine;
- using UnityEngine.UI;
- public class Test : MonoBehaviour
- {
- public Text wifiEnabledText;
- public Text bluetoothEnabledText;
-
- void Start()
- {
-
-
-
-
-
-
-
-
-
- NibiruTaskApi.SetInstallSuccessCallback(InstallSuccess);
- NibiruTaskApi.SetInstallFailedCallback(InstallFailed);
- NibiruTaskApi.SetUninstallSuccessCallback(UninstallSuccess);
- NibiruTaskApi.SetUninstallFailedCallback(UninstallFailed);
- }
- void InstallSuccess(string filePath, string packageName)
- {
- Debug.Log("InstallSuccessEvent:"+filePath+"---"+packageName);
- }
-
- void InstallFailed(string filePath, string packageName)
- {
- Debug.Log("InstallFailedEvent:"+filePath+"---"+packageName);
- }
-
- void UninstallSuccess(string packageName)
- {
- Debug.Log("UninstallSuccessEvent:"+packageName);
- }
-
- void UninstallFailed(string packageName)
- {
- Debug.Log("UninstallFailedEvent:"+packageName);
- }
-
-
-
-
-
-
-
-
- void Update()
- {
-
-
-
-
-
-
-
-
-
- if(wifiEnabledText) wifiEnabledText.text = "WifiEnabled:" +NibiruTaskApi.IsWifiEnabled();
- if(bluetoothEnabledText) bluetoothEnabledText.text = "BluetoothEnabled:" + NibiruTaskApi.IsBluetoothEnabled();
-
- if (Input.GetKeyUp(KeyCode.Escape))
- {
- Application.Quit();
- }
- }
-
-
-
-
-
-
-
- public void Click1()
- {
- NibiruTaskApi.SetWifiEnable(true);
- }
-
- public void Click2()
- {
-
- NibiruTaskApi.SetWifiEnable(false);
- }
-
- public void Click3()
- {
- NibiruTaskApi.SetBluetoothEnable(true);
- }
-
- public void Click4()
- {
- NibiruTaskApi.SetBluetoothEnable(false);
- }
-
- public void Click5()
- {
- NibiruTaskApi.GoToControllerDriver();
- }
-
- public void Click6()
- {
- NibiruTaskApi.InstallApk(NxrViewer.Instance.GetStoragePath()+"/Sensor_List.apk");
-
- }
-
- public void Click7()
- {
- NibiruTaskApi.UninstallApk("com.miian.android.sensors");
- }
- string numberList<T>(T[] array)
- {
- var str = "";
- foreach (var element in array)
- {
- str += element+" ";
- }
- return str;
- }
- }
|