补全防御塔组装与介绍描述功能

- RepoForm.CombineArea:防御塔组装,直接继承所有组件的属性
- ItemDescUtility:根据属性构建不同的 ItemDescForm 的文本
This commit is contained in:
SepComet
2026-03-04 18:17:10 +08:00
parent e12d2e73b2
commit 1e5803f4c5
29 changed files with 832 additions and 168 deletions
@@ -5,16 +5,16 @@ using UnityGameFramework.Runtime;
namespace GeometryTD.Entity
{
public class DefenseTowerEntity : EntityBase
public class TowerEntity : EntityBase
{
private DefenseTowerController _towerController;
private TowerController _towerController;
public void SetAttackRangeVisible(bool visible)
{
_towerController?.SetAttackRangeVisible(visible);
}
public bool TryApplyStats(DefenseTowerStatsData stats, int towerLevel)
public bool TryApplyStats(TowerStatsData stats, int towerLevel)
{
if (_towerController == null || stats == null)
{
@@ -29,7 +29,7 @@ namespace GeometryTD.Entity
{
base.OnInit(userData);
_towerController = GetComponent<DefenseTowerController>();
_towerController = GetComponent<TowerController>();
if (_towerController == null)
{
Log.Error("DefenseTowerController is missing on tower entity '{0}'.", name);
@@ -45,7 +45,7 @@ namespace GeometryTD.Entity
return;
}
if (userData is not DefenseTowerData towerData)
if (userData is not TowerData towerData)
{
Log.Warning("DefenseTowerData is invalid for tower entity '{0}'.", Id);
_towerController.OnReset();