修复报错
This commit is contained in:
@@ -16,7 +16,7 @@ Material:
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 3005
|
||||
m_CustomRenderQueue: 2005
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_LockedProperties: _AlphaTex
|
||||
|
||||
@@ -2,7 +2,6 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BigSpace.Logic;
|
||||
using BigSpace.XRCore.Event;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
|
||||
public class NengNiangQiuCtr : MonoBehaviour
|
||||
@@ -49,8 +48,8 @@ public class NengNiangQiuCtr : MonoBehaviour
|
||||
if (nengniangquObj_L.activeSelf)
|
||||
{
|
||||
nengniangquObj_L.SetActive(false);
|
||||
//在手的位置显示字
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//1:左手
|
||||
//<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -58,8 +57,8 @@ public class NengNiangQiuCtr : MonoBehaviour
|
||||
if (nengniangquObj_R.activeSelf)
|
||||
{
|
||||
nengniangquObj_R.SetActive(false);
|
||||
//在手的位置显示字
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//2:右手
|
||||
//<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//2:<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using BigSpace.Logic;
|
||||
using BigSpace.XRCore.Event;
|
||||
using RenderHeads.Media.AVProVideo;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
|
||||
public class SelfCharacterControllCtr : MonoBehaviour
|
||||
@@ -35,4 +34,4 @@ public class SelfCharacterControllCtr : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,42 +2,44 @@ using BigSpace.XRCore.Base;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.NetworkInformation;
|
||||
using Unity.XR.PICO.TOBSupport;
|
||||
using UnityEngine;
|
||||
|
||||
#if PICO_SDK || PXR_SDK
|
||||
using Unity.XR.PICO.TOBSupport;
|
||||
#endif
|
||||
|
||||
public class PicoFunc : Singleton<PicoFunc>
|
||||
{
|
||||
public string GetCode()
|
||||
{
|
||||
#if PICO_SDK || PXR_SDK
|
||||
if (Application.platform == RuntimePlatform.Android)
|
||||
{
|
||||
return PXR_Enterprise.StateGetDeviceInfo(SystemInfoEnum.EQUIPMENT_SN);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
string mac = "";
|
||||
NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
|
||||
foreach (NetworkInterface adaper in nis)
|
||||
{
|
||||
string mac = "";
|
||||
NetworkInterface[] nis = NetworkInterface.GetAllNetworkInterfaces();
|
||||
foreach (NetworkInterface adaper in nis)
|
||||
if (adaper.Description == "en0")
|
||||
{
|
||||
if (adaper.Description == "en0")
|
||||
{
|
||||
mac = adaper.GetPhysicalAddress().ToString();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
mac = adaper.GetPhysicalAddress().ToString();
|
||||
if (mac != "") break;
|
||||
}
|
||||
mac = adaper.GetPhysicalAddress().ToString();
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
mac = adaper.GetPhysicalAddress().ToString();
|
||||
if (mac != "") break;
|
||||
}
|
||||
return mac;
|
||||
}
|
||||
return mac;
|
||||
}
|
||||
|
||||
#region 获取电量和音量
|
||||
#region <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private static AndroidJavaObject audioManager = null;
|
||||
private const string currentVolume = "getStreamVolume";//当前音量
|
||||
private const string maxVolume = "getStreamMaxVolume";//最大音量
|
||||
private const string currentVolume = "getStreamVolume";//<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private const string maxVolume = "getStreamMaxVolume";//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
private const int STREAM_SYSTEM = 1;
|
||||
private float maxvo = 0;
|
||||
private float nowvo = 0;
|
||||
@@ -55,7 +57,7 @@ public class PicoFunc : Singleton<PicoFunc>
|
||||
}
|
||||
nowvo = float.Parse(audioManager.Call<int>(currentVolume, STREAM_SYSTEM).ToString());
|
||||
volum = Mathf.CeilToInt((nowvo / maxvo) * 100);
|
||||
//Debug.Log("音量:" + volum);
|
||||
//Debug.Log("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:" + volum);
|
||||
return (uint)volum;
|
||||
|
||||
//Debug.Log("STREAM_VOICE_CALL:" + audioManager.Call<int>(currentVolume, STREAM_VOICE_CALL).ToString());
|
||||
@@ -69,20 +71,13 @@ public class PicoFunc : Singleton<PicoFunc>
|
||||
}
|
||||
public uint GetBatter()
|
||||
{
|
||||
#if PICO_SDK || PXR_SDK
|
||||
if (Application.platform == RuntimePlatform.Android)
|
||||
{
|
||||
// 打印电池信息
|
||||
//Debug.Log("电池==============Battery Status: " + SystemInfo.batteryStatus);
|
||||
//Debug.Log("电池==============Battery Level: " + SystemInfo.batteryLevel * 100 + "%");
|
||||
//return (uint)Mathf.CeilToInt(SystemInfo.batteryLevel * 100);
|
||||
//Debug.Log("电量是多少:"+ PXR_Enterprise.StateGetDeviceInfo(SystemInfoEnum.ELECTRIC_QUANTITY));
|
||||
|
||||
return uint.Parse(PXR_Enterprise.StateGetDeviceInfo(SystemInfoEnum.ELECTRIC_QUANTITY));
|
||||
}
|
||||
else
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
#endif
|
||||
return 100;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
#if PICO_SDK || PXR_SDK
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
|
||||
public class PXR_PicoHandPinchGesture : PicoHandDeviceDoEvent
|
||||
{
|
||||
public HandType handType;
|
||||
private HandAimState aimState = new HandAimState();
|
||||
private bool aimRayTouched = false;
|
||||
private bool pinch = false;
|
||||
|
||||
public bool AimRayTouched { get => aimRayTouched; set => aimRayTouched = value; }
|
||||
private bool pinch = false;
|
||||
//private HandAimState aimState = new HandAimState();
|
||||
public float PinchStrength { get; private set; }
|
||||
|
||||
public bool Pinch
|
||||
{
|
||||
get => pinch;
|
||||
set {
|
||||
set
|
||||
{
|
||||
if (pinch != value)
|
||||
{
|
||||
if (value)
|
||||
@@ -31,7 +32,6 @@ public class PXR_PicoHandPinchGesture : PicoHandDeviceDoEvent
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
UpdateAimState();
|
||||
@@ -55,3 +55,10 @@ public class PXR_PicoHandPinchGesture : PicoHandDeviceDoEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
using UnityEngine;
|
||||
|
||||
public class PXR_PicoHandPinchGesture : PicoHandDeviceDoEvent
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.LowLevel;
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using BigSpace.Logic;
|
||||
using BigSpace.XRCore.Event;
|
||||
using BigSpace.XRCore.RunningScene;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
using static Unity.VisualScripting.Member;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
@@ -6,20 +6,19 @@ using BigSpace.XRCore.Scene;
|
||||
using System;
|
||||
using BigSpace.XRCore.Event;
|
||||
using BigSpace.Logic;
|
||||
using Unity.XR.PXR;
|
||||
public class SceneMgr : MonoSingleton<SceneMgr>
|
||||
{
|
||||
private Coroutine _currentCoroutine; // 当前正在进行的场景切换协程
|
||||
private ISceneDataProvider _sceneDataProvider; // 场景数据提供者
|
||||
private Coroutine _currentCoroutine; // <EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD>еij<EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>Э<EFBFBD><EFBFBD>
|
||||
private ISceneDataProvider _sceneDataProvider; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩ<EFBFBD><EFBFBD>
|
||||
private string _sceneName;
|
||||
public int nowSceneId = 0; //当前正式的场景(不包括中间过度场景)
|
||||
public bool isCanMove = true;//是否可以用手柄走动
|
||||
public int nowSceneId = 0; //<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD>ʽ<EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>)
|
||||
public bool isCanMove = true;//<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD>߶<EFBFBD>
|
||||
public bool isTrigger = false;
|
||||
public bool handisactive = false;
|
||||
/// <summary>
|
||||
/// 初始化场景管理器
|
||||
/// <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="sceneDataProvider">场景数据提供接口</param>
|
||||
/// <param name="sceneDataProvider"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩ<EFBFBD>ӿ<EFBFBD></param>
|
||||
public void Initialize(ISceneDataProvider sceneDataProvider)
|
||||
{
|
||||
_sceneDataProvider = sceneDataProvider;
|
||||
@@ -36,7 +35,7 @@ public class SceneMgr : MonoSingleton<SceneMgr>
|
||||
{
|
||||
if (_sceneName == arg0.name)
|
||||
{
|
||||
//Debug.Log("======================清了内存");
|
||||
//Debug.Log("======================<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>");
|
||||
Resources.UnloadUnusedAssets();
|
||||
GC.Collect();
|
||||
}
|
||||
@@ -49,40 +48,40 @@ public class SceneMgr : MonoSingleton<SceneMgr>
|
||||
Debug.LogWarning("A scene transition is already in progress.");
|
||||
return;
|
||||
}
|
||||
// 获取场景数据
|
||||
// <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
var loadingData = _sceneDataProvider.GetLoadingSceneData(sceneId);
|
||||
if (_sceneName != null && _sceneName == loadingData.SceneName) //同一个场景就不跳转
|
||||
if (_sceneName != null && _sceneName == loadingData.SceneName) //ͬһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD>ת
|
||||
return;
|
||||
|
||||
_sceneName = loadingData.SceneName;
|
||||
isTrigger = false;
|
||||
Debug.Log("开始跳转场景"+ _sceneName);
|
||||
Debug.Log("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"+ _sceneName);
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventSetHandMove, 1);
|
||||
_currentCoroutine = PersistenceCoroutineMgr.Instance.StartCoroutine(HandleSceneTransition(loadingData));
|
||||
}
|
||||
|
||||
public IEnumerator HandleSceneTransition(SceneData loadingData)
|
||||
{
|
||||
// 淡出
|
||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
GlobalEventMgr.Dispatch(GameEvent.EventChangeScence);
|
||||
ChangSceneSphereMgr.Instance.ShowChangeSecne(true);
|
||||
yield return new WaitForSeconds(GameDataManage.Instance.outFadeTime);
|
||||
//Debug.Log("ok淡出===========================" + loadingData.id + "||" + loadingData.LoadingSceneName + "||" + loadingData.SceneName);
|
||||
//Debug.Log("ok<EFBFBD><EFBFBD><EFBFBD><EFBFBD>===========================" + loadingData.id + "||" + loadingData.LoadingSceneName + "||" + loadingData.SceneName);
|
||||
if (!string.IsNullOrEmpty(loadingData.LoadingSceneName))
|
||||
{
|
||||
yield return SceneManager.LoadSceneAsync(loadingData.LoadingSceneName);
|
||||
|
||||
//旧UI相关
|
||||
//if (loadingData.SceneName != "Waiting" && loadingData.SceneName != "Scene_07") //关于等待出场景文字
|
||||
//<EFBFBD><EFBFBD>UI<EFBFBD><EFBFBD><EFBFBD>
|
||||
//if (loadingData.SceneName != "Waiting" && loadingData.SceneName != "Scene_07") //<EFBFBD><EFBFBD><EFBFBD>ڵȴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//{
|
||||
// //Debug.Log("跳谁:" + loadingData.id + "||" + loadingData.SceneName);
|
||||
// //Debug.Log("<EFBFBD><EFBFBD>˭:" + loadingData.id + "||" + loadingData.SceneName);
|
||||
// GlobalEventMgr.Dispatch(GameEvent.EventShowUI, loadingData.id % 10000);
|
||||
|
||||
// yield return new WaitForSeconds(4f);
|
||||
//}
|
||||
}
|
||||
|
||||
//Debug.Log("开始跳目标场景.................."+ loadingData.SceneName);
|
||||
//Debug.Log("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>Ŀ<EFBFBD>곡<EFBFBD><EFBFBD>.................."+ loadingData.SceneName);
|
||||
yield return SceneManager.LoadSceneAsync(loadingData.SceneName);
|
||||
_currentCoroutine = null;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#if PICO_SDK || PXR_SDK
|
||||
using Unity.XR.PICO.TOBSupport;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
@@ -687,4 +688,67 @@ public class PicoAPI : MonoBehaviour
|
||||
#endregion
|
||||
|
||||
}
|
||||
#else
|
||||
using UnityEngine;
|
||||
|
||||
public class PicoAPI : MonoBehaviour
|
||||
{
|
||||
public static PicoAPI _Instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_Instance == null)
|
||||
{
|
||||
_Instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
public void AcquireWakeLock() { }
|
||||
public void TryRecenter() { }
|
||||
public void OpenTouPing() { }
|
||||
public void OpenApp(string pkgName) { }
|
||||
public void OpenWIFI() { }
|
||||
public void PlayPicoVideo(string fileName) { }
|
||||
public void AppKeepAlive(string appPackageName) { }
|
||||
public void SetAppAsHome(string pkgName) { }
|
||||
public void SetUSBConfigMode() { }
|
||||
public void KillAppsByPidOrPackageName(string pkgName) { }
|
||||
public void KillBackgroundAppsWithWhiteList(string pkgName) { }
|
||||
public void SetIpd(float ipd) { }
|
||||
public void OffBoundary() { }
|
||||
public int[] GetControllerBattery() { return new int[0]; }
|
||||
public void InstallApk(string path) { }
|
||||
public void UnInstallApp(string appPackageName) { }
|
||||
public string PicoSN() { return ""; }
|
||||
public string PicoPower() { return "0"; }
|
||||
public string ChargingStatus() { return ""; }
|
||||
public string PicoWIFIState() { return ""; }
|
||||
public void ShutDown() { }
|
||||
public void Reboot() { }
|
||||
public void SetHomeNoAvail() { }
|
||||
public void RemoveControllerHomeKey() { }
|
||||
public void OffSystemUpdateApp() { }
|
||||
public void OffSystemUpdate() { }
|
||||
public void OffNavgation() { }
|
||||
public void OffKillVRapp() { }
|
||||
public void OnPowerCtrlWIFIEnable() { }
|
||||
public void OffAppQuitConfirmDialog() { }
|
||||
public void OnSixDof() { }
|
||||
public void HandRecenter() { }
|
||||
public void HandHome() { }
|
||||
public void OnUSBDebugging() { }
|
||||
public void OffCastNotification() { }
|
||||
public void PICOCastSetShowAuthorization() { }
|
||||
public void CastOption() { }
|
||||
public string GetCastUrl() { return ""; }
|
||||
public void OpenSystemUpdateApp() { }
|
||||
public void OpenSystemUpdate() { }
|
||||
public void OpenNavgation() { }
|
||||
public void OpenKillVRapp() { }
|
||||
public void OpenAppQuitConfirmDialog() { }
|
||||
public void OpenHandRecenter() { }
|
||||
public void OpenHandHome() { }
|
||||
public void SetVolumeNum(int volume) { }
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.PXR;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR;
|
||||
|
||||
@@ -9,26 +8,10 @@ public class HandTakeObj : MonoBehaviour
|
||||
{
|
||||
bool isEnterObj;
|
||||
Transform goodTran;
|
||||
//public PXR_Input.Controller hand;
|
||||
XRNode xrNode;
|
||||
public XRNode xrNode = XRNode.LeftHand;
|
||||
public Transform goodParent;
|
||||
Good good;
|
||||
|
||||
void Start()
|
||||
{
|
||||
switch (hand)
|
||||
{
|
||||
case PXR_Input.Controller.LeftController:
|
||||
xrNode = XRNode.LeftHand;
|
||||
break;
|
||||
case PXR_Input.Controller.RightController:
|
||||
xrNode = XRNode.RightHand;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (isEnterObj)
|
||||
|
||||
Reference in New Issue
Block a user