80 lines
2.2 KiB
C#
80 lines
2.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using UnityEngine;
|
|
|
|
public partial class SROptions
|
|
{
|
|
[Category("瑜伽设置"), DisplayName("设置内置摄像机")]
|
|
public void SetCameraIndex()
|
|
{
|
|
var devices = WebCamTexture.devices;
|
|
if (devices.Length == 0)
|
|
{
|
|
LogPrint.Error("No camera detected!");
|
|
return;
|
|
}
|
|
GlobalData.Instance.CameraIndex++;
|
|
if (GlobalData.Instance.CameraIndex >= devices.Length)
|
|
{
|
|
GlobalData.Instance.CameraIndex = 0;
|
|
}
|
|
|
|
EventManager.Instance.Dispatch(YogaEventType.ChangeCaptureCameraDevice);
|
|
}
|
|
|
|
[Category("瑜伽设置")]
|
|
public void PrintCurrentCamera()
|
|
{
|
|
var devices = WebCamTexture.devices;
|
|
if (devices.Length == 0)
|
|
{
|
|
LogPrint.Error("No camera detected!");
|
|
return;
|
|
}
|
|
|
|
LogPrint.Warning($"Current camera: {devices[GlobalData.Instance.CameraIndex].name}");
|
|
foreach (var device in devices)
|
|
{
|
|
LogPrint.Warning($"Camera: {device.name}");
|
|
}
|
|
}
|
|
|
|
[Category("瑜伽设置"), DisplayName("WebCamera和USBCamera之间转换")]
|
|
public void SetCameraDeviceType()
|
|
{
|
|
//WebCamera和USBCamera之间转换
|
|
EventManager.Instance.Dispatch(YogaEventType.DEBUG_CONSOLE_ChangeCamMode);
|
|
}
|
|
|
|
[Category("瑜伽设置"), DisplayName("动作捕捉开关")]
|
|
public void OnOffEstimationDebugMode()
|
|
{
|
|
GlobalData.Instance.IsEstimationPrintMode = !GlobalData.Instance.IsEstimationPrintMode;
|
|
}
|
|
|
|
[Category("瑜伽设置"), DisplayName("USB相机切换")]
|
|
public void ChangeUSBCamera()
|
|
{
|
|
var index = PlayerPrefs.GetInt("USBCameraIndex");
|
|
PlayerPrefs.SetInt("USBCameraIndex", ++index);
|
|
}
|
|
|
|
|
|
[Category("Debug 设置"), DisplayName("消息重要程度"), NumberRange(0, 3)]
|
|
public int DebugMessageFilterLevel
|
|
{
|
|
get
|
|
{
|
|
return LogPrint.Level;
|
|
}
|
|
set
|
|
{
|
|
LogPrint.Level = value;
|
|
}
|
|
}
|
|
|
|
//[Category("Debug 设置"), DisplayName("鱼眼透视畸变修正"), NumberRange(-3.5, 3.5)]
|
|
//public
|
|
|
|
} |