mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 02:47:12 +08:00
(client) feat:实现技能树界面,实现地图生成器,实现维度指定,实现规则瓦片定义,实现逃跑逻辑,实现消息定义,实现武器动画,实现受击动画 fix: 修复单攻击子弹击中多个目标,修复人物属性计算错误 (#56)
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/56
This commit is contained in:
@@ -23,7 +23,7 @@ public class Program : Singleton<Program>
|
||||
/// 当前聚焦的实体对象。
|
||||
/// 变更为属性,并私有化setter,确保通过 SetFocusedEntity 方法集中管理其更新和事件触发。
|
||||
/// </summary>
|
||||
public Entity.Entity FocusedEntity { get; private set; } = null;
|
||||
public Entity.Entity FocusedEntity => FocusedDimension?.focusEntity;
|
||||
|
||||
/// <summary>
|
||||
/// 当焦点实体发生变化时触发的事件。
|
||||
@@ -175,7 +175,7 @@ public class Program : Singleton<Program>
|
||||
return;
|
||||
}
|
||||
|
||||
if (FocusedEntity != null)
|
||||
if (FocusedEntity)
|
||||
{
|
||||
FocusedEntity.PlayerControlled = false;
|
||||
}
|
||||
@@ -200,17 +200,11 @@ public class Program : Singleton<Program>
|
||||
{
|
||||
// 优化:检查是否实际发生变化,避免不必要的更新和事件触发。
|
||||
// 如果新的实体与当前焦点实体相同(按引用比较),则不执行任何操作。
|
||||
if (FocusedEntity == entity)
|
||||
if (FocusedEntity == entity||!FocusedDimension)
|
||||
{
|
||||
// Debug.Log($"[Program] SetFocusedEntity: Entity '{entity?.name ?? "null"}' already current. No change needed.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 更新内部状态
|
||||
FocusedEntity = entity;
|
||||
if(FocusedDimension)
|
||||
FocusedDimension.focusEntity=entity;
|
||||
|
||||
FocusedDimension.focusEntity=entity;
|
||||
// 触发事件,将新的焦点实体(或 null)作为参数传递。
|
||||
OnFocusedEntityChanged?.Invoke(FocusedEntity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user