(client) feat:添加游玩时UI相关贴图,添加3d模型场景按钮,添加多级调色进度条,添加SVG图片包,添加事件定义以及管理器,添加音频管理器,定义部分怪物,添加通信协议定义;fix:修复维度切换错误,修复LogUI显示不正确 (#55)
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: #55
This commit is contained in:
@ -5,7 +5,7 @@ using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Character : Entity
|
||||
public class Character : LivingEntity
|
||||
{
|
||||
private int _currentSelected; // 私有字段用于存储实际值
|
||||
|
||||
@ -21,6 +21,7 @@ namespace Entity
|
||||
var maxIndex = Inventory != null && Inventory.Capacity > 0 ? Inventory.Capacity - 1 : 0;
|
||||
var clampedValue = Mathf.Clamp(value, 0, maxIndex);
|
||||
_currentSelected = clampedValue;
|
||||
InitWeaponAnimator();
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,29 +65,6 @@ namespace Entity
|
||||
return remainingQuantity;
|
||||
}
|
||||
|
||||
// public override void TryAttack()
|
||||
// {
|
||||
// if (IsAttacking)
|
||||
// return;
|
||||
// if (!DefineManager.Instance.defines.TryGetValue(nameof(BulletDef), out var def))
|
||||
// return;
|
||||
// // 修正:First() 可能会在一个空的 Values 集合上抛出异常。
|
||||
// // 更好的做法是使用 TryGetValue 或 FirstOrDefault 并检查结果。
|
||||
// // 这里假设至少有一个 BulletDef 存在,如果不是,需要更复杂的错误处理。
|
||||
// var bulletDefEntry = def.Values.FirstOrDefault();
|
||||
// if (bulletDefEntry == null)
|
||||
// {
|
||||
// Debug.LogError("No BulletDef found in DefineManager. Cannot attack.");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// var bulletDef = (BulletDef)bulletDefEntry;
|
||||
//
|
||||
// Vector3 dir = MousePosition.GetWorldPosition();
|
||||
// EntityManage.Instance.GenerateBulletEntity(Program.Instance.FocusedDimensionId, bulletDef, Position,
|
||||
// dir - Position, this);
|
||||
// }
|
||||
|
||||
public override WeaponResource GetCurrentWeapon()
|
||||
{
|
||||
var currentSelectItem = Inventory.GetSlot(CurrentSelected);
|
||||
|
Reference in New Issue
Block a user