上传YomovSDK

This commit is contained in:
Sora丶kong
2026-03-03 03:15:46 +08:00
parent 9096da7e6c
commit eb97f31065
6477 changed files with 1932208 additions and 3 deletions

View File

@@ -0,0 +1,103 @@
/*******************************************************************************
Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
NOTICEAll information contained herein is, and remains the property of
PICO Technology Co., Ltd. The intellectual and technical concepts
contained herein are proprietary to PICO Technology Co., Ltd. and may be
covered by patents, patents in process, and are protected by trade secret or
copyright law. Dissemination of this information or reproduction of this
material is strictly forbidden unless prior written permission is obtained from
PICO Technology Co., Ltd.
*******************************************************************************/
using System.IO;
using Unity.XR.PXR;
using UnityEditor;
using UnityEngine;
namespace Unity.XR.OpenXR.Features.PICOSupport
{
[System.Serializable]
public class PICOProjectSetting: ScriptableObject
{
public bool useContentProtect;
public bool isEyeTracking;
public bool MRSafeguard;
public bool isHandTracking;
public bool isEyeTrackingCalibration;
public bool highFrequencyHand;
public SystemDisplayFrequency displayFrequency;
public SecureContentFlag contentProtectFlags ;
public bool foveationEnable;
public FoveationFeature.FoveatedRenderingMode foveatedRenderingMode;
public FoveationFeature.FoveatedRenderingLevel foveatedRenderingLevel;
public bool isSubsampledEnabled;
public HandTrackingSupport handTrackingSupportType;
[SerializeField, Tooltip("Set the system splash screen picture in PNG format.")]
public Texture2D systemSplashScreen;
private string splashPath = string.Empty;
public static PICOProjectSetting GetProjectConfig()
{
PICOProjectSetting projectConfig = Resources.Load<PICOProjectSetting>("PICOProjectSetting");
#if UNITY_EDITOR
if (projectConfig == null)
{
projectConfig = CreateInstance<PICOProjectSetting>();
projectConfig.useContentProtect = false;
projectConfig.contentProtectFlags = SecureContentFlag.SECURE_CONTENT_OFF;
projectConfig.isEyeTracking = false;
projectConfig.isEyeTrackingCalibration = false;
projectConfig.handTrackingSupportType = HandTrackingSupport.ControllersAndHands;
projectConfig.isHandTracking = false;
projectConfig.MRSafeguard = false;
projectConfig.highFrequencyHand = false;
projectConfig.displayFrequency = SystemDisplayFrequency.Default;
projectConfig.foveationEnable = false;
projectConfig.foveatedRenderingMode = FoveationFeature.FoveatedRenderingMode.FixedFoveatedRendering;
projectConfig.foveatedRenderingLevel = FoveationFeature.FoveatedRenderingLevel.Off;
projectConfig.isSubsampledEnabled = false;
string path = Application.dataPath + "/Resources";
if (!Directory.Exists(path))
{
UnityEditor.AssetDatabase.CreateFolder("Assets", "Resources");
UnityEditor.AssetDatabase.CreateAsset(projectConfig, "Assets/Resources/PICOProjectSetting.asset");
}
else
{
UnityEditor.AssetDatabase.CreateAsset(projectConfig, "Assets/Resources/PICOProjectSetting.asset");
}
}
#endif
return projectConfig;
}
#if UNITY_EDITOR
private void OnValidate()
{
if (systemSplashScreen != null)
{
splashPath = AssetDatabase.GetAssetPath(systemSplashScreen);
if (Path.GetExtension(splashPath).ToLower() != ".png")
{
systemSplashScreen = null;
Debug.LogError("Invalid file format of System Splash Screen, only PNG format is supported. The asset path: " + splashPath);
splashPath = string.Empty;
}
}
}
public string GetSystemSplashScreen(string path)
{
if (systemSplashScreen == null || splashPath == string.Empty)
{
return "0";
}
string targetPath = Path.Combine(path, "src/main/assets/pico_splash.png");
FileUtil.ReplaceFile(splashPath, targetPath);
return "1";
}
#endif
}
}