using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEditor;

namespace SC.XR.Unity
{
    [Serializable]
    public class RecorderDetectorSettings
    {
        [SerializeField, Tooltip("Whether is screen recording")]
        public bool IsRecording = false;
    }
    [Serializable]
    public class BatteryDetectorSettings
    {
        [SerializeField, Tooltip("Whether the device is charging")]
        public bool IsCharging;
        [SerializeField, Tooltip("Whether the battery is under20")]
        public bool Under20;
        [SerializeField, Tooltip("Whether the battery is under15")]
        public bool Under15;
        [SerializeField, Tooltip("Whether the battery is under10")]
        public bool Under10;
        [SerializeField, Tooltip("Whether the battery is under5")]
        public bool Under5;
        [SerializeField, Tooltip("Whether the battery is under1")]
        public bool Under1;
        [SerializeField, Tooltip("Whether the right controller is connected")]
        public bool IsRightConnect;
        [SerializeField, Tooltip("Whether the right controller is unconnecting")]
        public bool IsRightUnconnecting;
        [SerializeField, Tooltip("Whether the right controller is low-power")]
        public bool IsRightLow;
        [SerializeField, Tooltip("Whether the left controller is connected")]
        public bool IsLeftConnect;
        [SerializeField, Tooltip("Whether the left controller is unconnecting")]
        public bool IsLeftUnconnecting;
        [SerializeField, Tooltip("Whether the left controller is low-power")]
        public bool IsLeftLow;
        [SerializeField, Tooltip("Whether the hand tracking is enabled")]
        public bool IsHandTracking;
    }
    [Serializable]
    public class SafetyAreaSettings
    {
        [SerializeField, Tooltip("Height of device when setting safety area")]
        public float SafetyAreaHeight = 1.6f;
    }

    [CreateAssetMenu(fileName = "SDKGlobalConfiguration", menuName = "SCConfig/SDKGlobalConfiguration")]
    public class SDKGlobalConfiguration : ScriptableObject
    {
        [Space(10)]
        [SerializeField]
        public RecorderDetectorSettings RecorderDetectorSettings = new RecorderDetectorSettings();
        [Space(10)]
        [SerializeField]
        public BatteryDetectorSettings BatteryDetectorSettings = new BatteryDetectorSettings();
        [Space(10)]
        [SerializeField]
        public SafetyAreaSettings SafetyAreaSettings = new SafetyAreaSettings();
    }

    //public class EditorWindows: EditorWindow
    //{
    //    private Editor editor;
    //    [MenuItem("SDK/Settings/SDK Configuration")]
    //    public static void ShowConfigWindow()
    //    {
    //        var window = EditorWindow.GetWindow<EditorWindows>(true, "SDK Configuration", true);
    //        window.editor = Editor.CreateEditor(ScriptableObject.CreateInstance<SDKConfiguration>());
    //    }

    //    [MenuItem("SDK/Settings/SDK Global Configuration")]
    //    public static void ShowGlobalConfigWindow()
    //    {
    //        var window = EditorWindow.GetWindow<EditorWindows>(true, "SDK Global Configuration", true);
    //        window.editor = Editor.CreateEditor(ScriptableObject.CreateInstance<SDKGlobalConfiguration>());
    //    }
    //    private void OnGUI()
    //    {
    //        this.editor.OnInspectorGUI();
    //    }
    //}
}