(client)feat:实现按武器释放技能

This commit is contained in:
m0_75251201
2025-08-27 19:08:27 +08:00
parent 63efa89ac1
commit 5315e29147
25 changed files with 1184 additions and 5106 deletions

View File

@ -39,7 +39,7 @@ namespace Managers
/// <summary> 角色实体的预制体。 </summary>
public EntityPrefab characterPrefab;
public EntityPrefab monsterPrefab;
/// <summary> 建筑实体的预制体。 </summary>
public EntityPrefab buildingPrefab;
@ -369,7 +369,30 @@ namespace Managers
);
if (result == null) GenerateDefaultEntity(dimensionId, pos);
}
public void GenerateMonsterEntity(string dimensionId, MonsterDef monsterDef, Vector3 pos)
{
if (!monsterPrefab)
{
Debug.LogError("实体管理器monsterPrefab 为空!请分配一个有效的预制体。");
GenerateDefaultEntity(dimensionId, pos);
return;
}
if (monsterDef == null)
{
Debug.LogError("实体管理器monsterDef 为空!无法生成实体。");
GenerateDefaultEntity(dimensionId, pos);
return;
}
var result = GenerateEntityInternal(
dimensionId,
monsterPrefab.gameObject,
pos,
monsterDef
);
if (result == null) GenerateDefaultEntity(dimensionId, pos);
}
/// <summary>
/// 在指定维度和网格位置生成一个建筑实体。
/// </summary>