diff --git a/Assets/Res/Models/Environments/Intro/Materials/RedFrame.mat b/Assets/Res/Models/Environments/Intro/Materials/RedFrame.mat index 059eb5d0..444299b5 100644 --- a/Assets/Res/Models/Environments/Intro/Materials/RedFrame.mat +++ b/Assets/Res/Models/Environments/Intro/Materials/RedFrame.mat @@ -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 diff --git a/Assets/Scripts/Hand/NengNiangQiuCtr.cs b/Assets/Scripts/Hand/NengNiangQiuCtr.cs index 5c63da2b..cf237248 100644 --- a/Assets/Scripts/Hand/NengNiangQiuCtr.cs +++ b/Assets/Scripts/Hand/NengNiangQiuCtr.cs @@ -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:左手 + //锟斤拷锟街碉拷位锟斤拷锟斤拷示锟斤拷 + GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//1锟斤拷锟斤拷锟斤拷 } } 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:右手 + //锟斤拷锟街碉拷位锟斤拷锟斤拷示锟斤拷 + GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//2:锟斤拷锟斤拷 } } } diff --git a/Assets/Scripts/Help/SelfCharacterControllCtr.cs b/Assets/Scripts/Help/SelfCharacterControllCtr.cs index 0014e7c6..71f0b16a 100644 --- a/Assets/Scripts/Help/SelfCharacterControllCtr.cs +++ b/Assets/Scripts/Help/SelfCharacterControllCtr.cs @@ -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 } - \ No newline at end of file + diff --git a/Assets/Scripts/Logic/Network/PicoFunc.cs b/Assets/Scripts/Logic/Network/PicoFunc.cs index f9ee2078..84978f1f 100644 --- a/Assets/Scripts/Logic/Network/PicoFunc.cs +++ b/Assets/Scripts/Logic/Network/PicoFunc.cs @@ -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 { 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 锟斤拷取锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 private static AndroidJavaObject audioManager = null; - private const string currentVolume = "getStreamVolume";//当前音量 - private const string maxVolume = "getStreamMaxVolume";//最大音量 + private const string currentVolume = "getStreamVolume";//锟斤拷前锟斤拷锟斤拷 + private const string maxVolume = "getStreamMaxVolume";//锟斤拷锟斤拷锟斤拷锟 private const int STREAM_SYSTEM = 1; private float maxvo = 0; private float nowvo = 0; @@ -55,7 +57,7 @@ public class PicoFunc : Singleton } nowvo = float.Parse(audioManager.Call(currentVolume, STREAM_SYSTEM).ToString()); volum = Mathf.CeilToInt((nowvo / maxvo) * 100); - //Debug.Log("音量:" + volum); + //Debug.Log("锟斤拷锟斤拷:" + volum); return (uint)volum; //Debug.Log("STREAM_VOICE_CALL:" + audioManager.Call(currentVolume, STREAM_VOICE_CALL).ToString()); @@ -69,20 +71,13 @@ public class PicoFunc : Singleton } 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 } diff --git a/Assets/Scripts/MyHandReset/PXR_PicoHandPinchGesture.cs b/Assets/Scripts/MyHandReset/PXR_PicoHandPinchGesture.cs index 6e6df85a..53224e17 100644 --- a/Assets/Scripts/MyHandReset/PXR_PicoHandPinchGesture.cs +++ b/Assets/Scripts/MyHandReset/PXR_PicoHandPinchGesture.cs @@ -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 diff --git a/Assets/Scripts/MyHandReset/PicoHandDeviceDoEvent.cs b/Assets/Scripts/MyHandReset/PicoHandDeviceDoEvent.cs index e861ec70..01f914a2 100644 --- a/Assets/Scripts/MyHandReset/PicoHandDeviceDoEvent.cs +++ b/Assets/Scripts/MyHandReset/PicoHandDeviceDoEvent.cs @@ -1,6 +1,5 @@ using System.Collections; using System.Collections.Generic; -using Unity.XR.PXR; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.LowLevel; diff --git a/Assets/Scripts/Scene_04/PlayJiaGuAnimator.cs b/Assets/Scripts/Scene_04/PlayJiaGuAnimator.cs index 15cdbc05..5db2e664 100644 --- a/Assets/Scripts/Scene_04/PlayJiaGuAnimator.cs +++ b/Assets/Scripts/Scene_04/PlayJiaGuAnimator.cs @@ -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; diff --git a/Assets/Scripts/XRCore/Scene/SceneMgr.cs b/Assets/Scripts/XRCore/Scene/SceneMgr.cs index bc0dbda7..ff7cd0bc 100644 --- a/Assets/Scripts/XRCore/Scene/SceneMgr.cs +++ b/Assets/Scripts/XRCore/Scene/SceneMgr.cs @@ -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 { - private Coroutine _currentCoroutine; // 当前正在进行的场景切换协程 - private ISceneDataProvider _sceneDataProvider; // 场景数据提供者 + private Coroutine _currentCoroutine; // 锟斤拷前锟斤拷锟节斤拷锟叫的筹拷锟斤拷锟叫伙拷协锟斤拷 + private ISceneDataProvider _sceneDataProvider; // 锟斤拷锟斤拷锟斤拷锟斤拷锟结供锟斤拷 private string _sceneName; - public int nowSceneId = 0; //当前正式的场景(不包括中间过度场景) - public bool isCanMove = true;//是否可以用手柄走动 + public int nowSceneId = 0; //锟斤拷前锟斤拷式锟侥筹拷锟斤拷(锟斤拷锟斤拷锟斤拷锟叫硷拷锟斤拷瘸锟斤拷锟) + public bool isCanMove = true;//锟角凤拷锟斤拷锟斤拷锟斤拷直锟斤拷叨锟 public bool isTrigger = false; public bool handisactive = false; /// - /// 初始化场景管理器 + /// 锟斤拷始锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 /// - /// 场景数据提供接口 + /// 锟斤拷锟斤拷锟斤拷锟斤拷锟结供锟接匡拷 public void Initialize(ISceneDataProvider sceneDataProvider) { _sceneDataProvider = sceneDataProvider; @@ -36,7 +35,7 @@ public class SceneMgr : MonoSingleton { if (_sceneName == arg0.name) { - //Debug.Log("======================清了内存"); + //Debug.Log("======================锟斤拷锟斤拷锟节达拷"); Resources.UnloadUnusedAssets(); GC.Collect(); } @@ -49,40 +48,40 @@ public class SceneMgr : MonoSingleton Debug.LogWarning("A scene transition is already in progress."); return; } - // 获取场景数据 + // 锟斤拷取锟斤拷锟斤拷锟斤拷锟斤拷 var loadingData = _sceneDataProvider.GetLoadingSceneData(sceneId); - if (_sceneName != null && _sceneName == loadingData.SceneName) //同一个场景就不跳转 + if (_sceneName != null && _sceneName == loadingData.SceneName) //同一锟斤拷锟斤拷锟斤拷锟酵诧拷锟斤拷转 return; _sceneName = loadingData.SceneName; isTrigger = false; - Debug.Log("开始跳转场景"+ _sceneName); + Debug.Log("锟斤拷始锟斤拷转锟斤拷锟斤拷"+ _sceneName); GlobalEventMgr.Dispatch(GameEvent.EventSetHandMove, 1); _currentCoroutine = PersistenceCoroutineMgr.Instance.StartCoroutine(HandleSceneTransition(loadingData)); } public IEnumerator HandleSceneTransition(SceneData loadingData) { - // 淡出 + // 锟斤拷锟斤拷 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锟斤拷锟斤拷===========================" + 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") //关于等待出场景文字 + //锟斤拷UI锟斤拷锟 + //if (loadingData.SceneName != "Waiting" && loadingData.SceneName != "Scene_07") //锟斤拷锟节等达拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 //{ - // //Debug.Log("跳谁:" + loadingData.id + "||" + loadingData.SceneName); + // //Debug.Log("锟斤拷谁:" + loadingData.id + "||" + loadingData.SceneName); // GlobalEventMgr.Dispatch(GameEvent.EventShowUI, loadingData.id % 10000); // yield return new WaitForSeconds(4f); //} } - //Debug.Log("开始跳目标场景.................."+ loadingData.SceneName); + //Debug.Log("锟斤拷始锟斤拷目锟疥场锟斤拷.................."+ loadingData.SceneName); yield return SceneManager.LoadSceneAsync(loadingData.SceneName); _currentCoroutine = null; } diff --git a/Assets/浠g爜/PicoSDK/PicoAPI.cs b/Assets/浠g爜/PicoSDK/PicoAPI.cs index 037f44e3..b8459a3e 100644 --- a/Assets/浠g爜/PicoSDK/PicoAPI.cs +++ b/Assets/浠g爜/PicoSDK/PicoAPI.cs @@ -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 diff --git a/Assets/浠g爜/Pico浜や簰/HandTakeObj.cs b/Assets/浠g爜/Pico浜や簰/HandTakeObj.cs index 49431277..ab8282d0 100644 --- a/Assets/浠g爜/Pico浜や簰/HandTakeObj.cs +++ b/Assets/浠g爜/Pico浜や簰/HandTakeObj.cs @@ -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)