This commit is contained in:
CortexCore
2025-02-24 23:02:49 +08:00
parent 9775bdd099
commit b07ae4fea7
82 changed files with 1021 additions and 386 deletions

View File

@@ -13,5 +13,5 @@
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
"noEngineReferences": false
}

View File

@@ -5,88 +5,92 @@ namespace Project.B.Player
/// <summary>
/// 玩家键位
/// </summary>
public interface IPlayerKeyMap:IKeyMap
public interface IPlayerKeyMap<T>:IKeyMap
{
/// <summary>
/// 移动
/// </summary>
public string MovementKey { get; set; }
public T MovementKey { get; }
/// <summary>
/// 视角
/// </summary>
public string ViewKey { get; set; }
public T ViewKey { get; }
/// <summary>
/// 跳跃
/// </summary>
public string JumpKey { get; set; }
public T JumpKey { get; }
/// <summary>
/// 奔跑
/// </summary>
public string RunKey{ get; set; }
public T RunKey{ get; }
/// <summary>
/// 蹲下
/// </summary>
public string CrouchKey { get; set; }
public T CrouchKey{ get; }
/// <summary>
/// 切换第三人称相机
/// </summary>
public string ToggleCameraKey { get; set; }
public T ToggleCameraKey{ get; }
/// <summary>
/// 互动
/// </summary>
public string InteractiveKey { get; }
public T InteractiveKey { get; }
/// <summary>
/// 收起武器
/// </summary>
public string HolsterKey { get; }
public T HolsterKey { get; }
/// <summary>
/// 主武器
/// </summary>
public string PrimaryWeaponKey { get; }
public T PrimaryWeaponKey { get; }
/// <summary>
/// 副武器
/// </summary>
public string SecondaryWeaponKey { get; }
public T SecondaryWeaponKey{ get; }
/// <summary>
/// 随身武器
/// </summary>
public string SidearmKey { get; }
public T SidearmKey { get; }
/// <summary>
/// 消耗品
/// </summary>
public string SuppliesKey { get; }
public T SuppliesKey { get; }
/// <summary>
/// 战术道具
/// </summary>
public string TacticalKey { get; }
public T TacticalKey { get; }
/// <summary>
/// 致命道具
/// </summary>
public string LethalKey { get; }
public T LethalKey { get; }
/// <summary>
/// 连杀道具
/// </summary>
public string KillStreakKey { get; }
public T KillStreakKey { get; }
/// <summary>
/// 滚轮缩放,在不同状态下有不同的表现
/// </summary>
public string ScrollKey { get; }
public T ScrollKey { get; }
/// <summary>
/// 近战
/// </summary>
public string MeleeKey { get; }
public T MeleeKey { get; }
/// <summary>
/// 重装
/// </summary>
public string ReloadKey { get; }
public T ReloadKey { get; }
/// <summary>
/// 瞄准
/// </summary>
public string AimKey { get; }
public T AimKey { get; }
/// <summary>
/// 开火
/// </summary>
public string FireKey { get; }
public T FireKey { get; }
/// <summary>
/// 检视
/// </summary>
public T InspectKey { get; }
}
}

View File

@@ -1,33 +1,85 @@
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,
}
#endif
/// <summary>
/// 玩家设置
/// </summary>
public interface IPlayerSettings
public class PlayerSettings
{
/// <summary>
/// 灵敏度
/// </summary>
public float Sensitivity { get; set; }
public float GamePadSensitivity { get; set; }
[Category("控制")]
[DisplayName("鼠标灵敏度")]
public float Sensitivity { get; set; } = 1.81f;
[DisplayName("手柄灵敏度")] public float GamePadSensitivity { get; set; } = 1;
[DisplayName("触屏灵敏度")] public float TouchSensitivity { get; set; } = 0.32f;
/// <summary>
/// 视野
/// </summary>
public int Fov { get; set; }
[Category("画面")]
[DisplayName("FOV")]
public int Fov { get; set; } = 90;
/// <summary>
/// 刷新率
/// 第三人称视野
/// </summary>
public int Freq { get; }
[DisplayName("TPS FOV")]
public int TpsFov { get; set; } = 75;
/// <summary>
/// 分辨率
/// </summary>
public int2 Resolution { get; set; }
[DisplayName("分辨率")] public int2 Resolution { get; set; }
/// <summary>
/// 是否全屏
/// </summary>
public bool IsFullScreen { get; set; }
[DisplayName("全屏")] public bool IsFullScreen { get; set; }
[Category("质量")]
[DisplayName("实时反射Cubemap")]public bool RealtimeReflectionProbes { get; set; }
[DisplayName("纹理串流")] public bool TextureStreaming { get; set; }
#if UNITY_5_3_OR_NEWER
[DisplayName("垂直同步")]
public VSyncCount VSyncCount { get; set; }
[DisplayName("实时GI使用率")]
public RealtimeGICPUUsage RealtimeGICPUUsage { get; set; }
[DisplayName("纹理质量")]
public GlobalMipmapLimit GlobalMipmapLimit { get; set; }
[DisplayName("各向异性")] public AnisotropicFiltering AnisotropicFiltering { get; set; }
[DisplayName("阴影模式")] public ShadowmaskMode ShadowmaskMode { get; set; }
[DisplayName("蒙皮权重")] public SkinWeights SkinWeights { get; set; }
#endif
}
}

View File

@@ -3,10 +3,10 @@ using System.Collections.Generic;
namespace Project.B.Player
{
public interface IUXKeyMap : IKeyMap
public interface IUXKeyMap<T> : IKeyMap
{
public string CancelKey { get; set; }
public string InventoryKey { get; set; }
public string ConfirmKey { get; set; }
public T CancelKey { get; }
public T InventoryKey { get; }
public T ConfirmKey { get; }
}
}