using System;
using System.ComponentModel;
using MemoryPack;
using Unity.Mathematics;
#if UNITY_5_3_OR_NEWER
        using UnityEngine;
#endif
namespace Project.B.Player
{
    #if UNITY_5_3_OR_NEWER
    public enum VSyncCount
    {
        DontSync,
        EveryVBlank,
        EverySecondVBlank
    }
    public enum RealtimeGICPUUsage
    {
        Low,
        Medium,
        High,
        Unlimited
    }

    public enum GlobalMipmapLimit
    {
        FullResolution,
        HalfResolution,
        QuarterResolution,
        EighthResolution,
    }
    public enum Lang
    {
        [Description("zh-CN")]
        CN,
        [Description("en-US")]
        EN,
        [Description("ja-JP")]
        JP,
    }
    #endif
    /// <summary>
    /// 玩家设置
    /// </summary>
    public class PlayerSettings
    {
        [Category("UI")]
        [DisplayName("Settings_Lang")]
        public Lang Lang { get; set; }
        public string Language => Lang switch
        {
            Lang.EN => "en-US",
            Lang.JP => "ja-JP",
            _ => "zh-CN"
        };
        /// <summary>
        /// 灵敏度
        /// </summary>
        [Category("控制")]
        [DisplayName("Settings_Sensitivity")]
        public float Sensitivity { get; set; } = 1.81f;

        [DisplayName("Settings_Controller_Sensitivity")] public float GamePadSensitivity { get; set; } = 1;

        [DisplayName("Settings_Touch_Sensitivity")] public float TouchSensitivity { get; set; } = 0.32f;

        /// <summary>
        /// 视野
        /// </summary>
        [Category("画面")]
        [DisplayName("Settings_FOV")]
        public int Fov { get; set; } = 90;
        /// <summary>
        /// 第三人称视野
        /// </summary>
        [DisplayName("Settings_TPS_FOV")]
        public int TpsFov { get; set; } = 75;
        /// <summary>
        /// 分辨率
        /// </summary>
        [DisplayName("Settings_Resolution")] public int2 Resolution { get; set; }
        /// <summary>
        /// 是否全屏
        /// </summary>
        [DisplayName("Settings_FullScreen")] public bool IsFullScreen { get; set; }
        [Category("质量")]
        [DisplayName("Settings_Realtime_Reflection_Probes")]public bool RealtimeReflectionProbes { get; set; }

        [DisplayName("Setting_Texture_Streaming")] public bool TextureStreaming { get; set; }
        #if UNITY_5_3_OR_NEWER
        [DisplayName("Settings_VSync_Count")]
        public VSyncCount VSyncCount { get; set; }
        [DisplayName("Settings_Realtime_GI_CPU_Usage")]
        public RealtimeGICPUUsage RealtimeGICPUUsage { get; set; }
        [DisplayName("Settings_Global_MipMap_Limit")]
        public GlobalMipmapLimit GlobalMipmapLimit { get; set; }
        [DisplayName("Settings_Anisotropic_Filtering")] public AnisotropicFiltering AnisotropicFiltering { get; set; }
        [DisplayName("Settings_Shadowmask_Mode")] public ShadowmaskMode ShadowmaskMode { get; set; }
        [DisplayName("Settings_SkinWeights")] public SkinWeights SkinWeights { get; set; }
#endif
    }

}

