(client)feat:实现按武器释放技能
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user