修复报错
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user