using System; using UnityEngine; public class GlobalData : MonoSingleton { private PositionType _position = PositionType.None; private int _cameraIndex = 0; private bool _isEstimationDebugMode = true; private bool _isFlip = false; private bool _showFaceDetectCameraCaptureImage = false; 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; } public int CameraIndex { get => _cameraIndex; internal set => _cameraIndex = value; } public bool IsEstimationPrintMode { get => _isEstimationDebugMode; internal set => _isEstimationDebugMode = value; } public bool ShowFaceDetectCameraCaptureImage { get => _showFaceDetectCameraCaptureImage; internal set => _showFaceDetectCameraCaptureImage = value; } } public enum InputDeviceType { WebCamera, USBCamera, Video, Pictures, }