Net.Project.B/Src/PlayerSettings/IPlayerSettings.cs

105 lines
3.0 KiB
C#
Raw Normal View History

2025-02-24 23:02:49 +08:00
using System;
using System.ComponentModel;
using MemoryPack;
2024-11-23 17:20:13 +08:00
using Unity.Mathematics;
2025-02-24 23:02:49 +08:00
#if UNITY_5_3_OR_NEWER
using UnityEngine;
#endif
2024-11-23 17:20:13 +08:00
namespace Project.B.Player
{
2025-02-24 23:02:49 +08:00
#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,
}
2025-03-10 18:06:24 +08:00
public enum Lang
{
[Description("zh-CN")]
CN,
[Description("en-US")]
EN,
[Description("ja-JP")]
JP,
}
2025-02-24 23:02:49 +08:00
#endif
2024-11-23 17:20:13 +08:00
/// <summary>
/// 玩家设置
/// </summary>
2025-02-24 23:02:49 +08:00
public class PlayerSettings
2024-11-23 17:20:13 +08:00
{
2025-03-10 18:06:24 +08:00
[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"
};
2024-11-23 17:20:13 +08:00
/// <summary>
/// 灵敏度
/// </summary>
2025-02-24 23:02:49 +08:00
[Category("控制")]
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Sensitivity")]
2025-02-24 23:02:49 +08:00
public float Sensitivity { get; set; } = 1.81f;
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Controller_Sensitivity")] public float GamePadSensitivity { get; set; } = 1;
2025-02-24 23:02:49 +08:00
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Touch_Sensitivity")] public float TouchSensitivity { get; set; } = 0.32f;
2025-02-24 23:02:49 +08:00
2024-11-23 17:20:13 +08:00
/// <summary>
/// 视野
/// </summary>
2025-02-24 23:02:49 +08:00
[Category("画面")]
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_FOV")]
2025-02-24 23:02:49 +08:00
public int Fov { get; set; } = 90;
2024-11-23 17:20:13 +08:00
/// <summary>
2025-02-24 23:02:49 +08:00
/// 第三人称视野
2024-11-23 17:20:13 +08:00
/// </summary>
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_TPS_FOV")]
2025-02-24 23:02:49 +08:00
public int TpsFov { get; set; } = 75;
2024-11-23 17:20:13 +08:00
/// <summary>
/// 分辨率
/// </summary>
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Resolution")] public int2 Resolution { get; set; }
2024-11-23 17:20:13 +08:00
/// <summary>
/// 是否全屏
/// </summary>
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_FullScreen")] public bool IsFullScreen { get; set; }
2025-02-24 23:02:49 +08:00
[Category("质量")]
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Realtime_Reflection_Probes")]public bool RealtimeReflectionProbes { get; set; }
2025-02-24 23:02:49 +08:00
2025-03-10 18:06:24 +08:00
[DisplayName("Setting_Texture_Streaming")] public bool TextureStreaming { get; set; }
2025-02-24 23:02:49 +08:00
#if UNITY_5_3_OR_NEWER
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_VSync_Count")]
2025-02-24 23:02:49 +08:00
public VSyncCount VSyncCount { get; set; }
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Realtime_GI_CPU_Usage")]
2025-02-24 23:02:49 +08:00
public RealtimeGICPUUsage RealtimeGICPUUsage { get; set; }
2025-03-10 18:06:24 +08:00
[DisplayName("Settings_Global_MipMap_Limit")]
2025-02-24 23:02:49 +08:00
public GlobalMipmapLimit GlobalMipmapLimit { get; set; }
2025-03-10 18:06:24 +08:00
[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; }
2025-02-24 23:02:49 +08:00
#endif
2024-11-23 17:20:13 +08:00
}
}