Health/Assets/Scripts/Service/GlobalData.cs

43 lines
1.2 KiB
C#
Raw Normal View History

2023-11-27 05:49:53 +00:00
using System;
using UnityEngine;
2023-11-22 12:34:04 +00:00
public class GlobalData : MonoSingleton<GlobalData>
{
2023-11-22 12:34:04 +00:00
private PositionType _position = PositionType.None;
private int _cameraIndex = 0;
2023-11-24 12:04:16 +00:00
private bool _isEstimationDebugMode = true;
2023-11-27 05:49:53 +00:00
private bool _isFlip = false;
private bool _showFaceDetectCameraCaptureImage = false;
2023-11-22 12:34:04 +00:00
2023-11-27 05:49:53 +00:00
public PositionType Position
{
get => _position;
internal set => _position = value;
}
public bool IsDriverPosition
{
get
{
return (IsFlip ? _position != PositionType.Driver : _position == PositionType.Driver); //图像反向时,主驾驶和副驾驶的位置判断相反
}
}
public bool IsFlip
{
get => _isFlip;
internal set => _isFlip = value;
}
2023-11-22 12:34:04 +00:00
public int CameraIndex { get => _cameraIndex; internal set => _cameraIndex = value; }
2023-11-24 18:39:53 +00:00
public bool IsEstimationPrintMode { get => _isEstimationDebugMode; internal set => _isEstimationDebugMode = value; }
public bool ShowFaceDetectCameraCaptureImage { get => _showFaceDetectCameraCaptureImage; internal set => _showFaceDetectCameraCaptureImage = value; }
2023-11-22 12:34:04 +00:00
}
2023-11-24 12:04:16 +00:00
public enum InputDeviceType
2023-11-22 12:34:04 +00:00
{
2023-11-24 12:04:16 +00:00
WebCamera,
USBCamera,
Video,
Pictures,
}