2023-11-22 12:34:04 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public partial class SROptions
|
|
|
|
|
{
|
2023-11-24 12:04:16 +00:00
|
|
|
|
[Category("<22><>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>"), DisplayName("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")]
|
2023-11-22 12:34:04 +00:00
|
|
|
|
public void SetCameraIndex()
|
|
|
|
|
{
|
|
|
|
|
var devices = WebCamTexture.devices;
|
|
|
|
|
if (devices.Length == 0)
|
|
|
|
|
{
|
2023-11-24 05:13:10 +00:00
|
|
|
|
LogPrint.Error("No camera detected!");
|
2023-11-22 12:34:04 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GlobalData.Instance.CameraIndex++;
|
|
|
|
|
if (GlobalData.Instance.CameraIndex >= devices.Length)
|
|
|
|
|
{
|
|
|
|
|
GlobalData.Instance.CameraIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Dispatch(YogaEventType.ChangeCaptureCameraDevice);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-24 12:04:16 +00:00
|
|
|
|
[Category("<22><>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>")]
|
2023-11-22 12:34:04 +00:00
|
|
|
|
public void PrintCurrentCamera()
|
|
|
|
|
{
|
|
|
|
|
var devices = WebCamTexture.devices;
|
|
|
|
|
if (devices.Length == 0)
|
|
|
|
|
{
|
2023-11-24 05:13:10 +00:00
|
|
|
|
LogPrint.Error("No camera detected!");
|
2023-11-22 12:34:04 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-24 05:13:10 +00:00
|
|
|
|
LogPrint.Warning($"Current camera: {devices[GlobalData.Instance.CameraIndex].name}");
|
2023-11-22 12:34:04 +00:00
|
|
|
|
foreach (var device in devices)
|
|
|
|
|
{
|
2023-11-24 05:13:10 +00:00
|
|
|
|
LogPrint.Warning($"Camera: {device.name}");
|
2023-11-22 12:34:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-24 12:04:16 +00:00
|
|
|
|
[Category("<22><>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>")]
|
2023-11-22 12:34:04 +00:00
|
|
|
|
public void SetCameraDeviceType()
|
|
|
|
|
{
|
2023-11-24 12:04:16 +00:00
|
|
|
|
if (GlobalData.Instance.InputDeviceType == InputDeviceType.WebCamera)
|
2023-11-22 12:34:04 +00:00
|
|
|
|
{
|
2023-11-24 12:04:16 +00:00
|
|
|
|
GlobalData.Instance.InputDeviceType = InputDeviceType.USBCamera;
|
2023-11-22 12:34:04 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2023-11-24 12:04:16 +00:00
|
|
|
|
GlobalData.Instance.InputDeviceType = InputDeviceType.WebCamera;
|
2023-11-22 12:34:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Dispatch(YogaEventType.ChangeCaptureCameraDevice);
|
|
|
|
|
}
|
2023-11-24 12:04:16 +00:00
|
|
|
|
|
|
|
|
|
[Category("<22><>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>"), DisplayName("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BD><EFBFBD><EFBFBD>")]
|
|
|
|
|
public void OnOffEstimationDebugMode()
|
|
|
|
|
{
|
|
|
|
|
GlobalData.Instance.IsEstimationDebugMode = !GlobalData.Instance.IsEstimationDebugMode;
|
|
|
|
|
}
|
2023-11-22 12:34:04 +00:00
|
|
|
|
}
|