CombatNode 相关逻辑补充

- CombatFinishForm:战斗节点的结算页面(杀死的敌人、获得的金币、获得的道具)
- CombatSelectForm:战斗节点建造防御塔的选择 UI 以及对防御塔进行操作的 UI(只实现了建造逻辑,在 MapEntity 里做射线检测)
- 构建了基本的防御塔三组件(ShooterMuzzleComp/BasicBearingComp/BasicBaseComp)和防御塔主控(DefenseTowerController)以及相应的实体类(DefenseTowerEntity)
This commit is contained in:
SepComet
2026-03-01 23:11:52 +08:00
parent 92cca14503
commit 564817d752
96 changed files with 7294 additions and 121 deletions
@@ -0,0 +1,66 @@
using System;
using GeometryTD.Definition;
using UnityEngine;
namespace GeometryTD.Entity.EntityData
{
[Serializable]
public class BulletData : EntityDataBase
{
[SerializeField] private Transform _target = null;
[SerializeField] private int _damage = 0;
[SerializeField] private float _speed = 0f;
[SerializeField] private float _maxLifetime = 3f;
[SerializeField] private AttackPropertyType _attackPropertyType = AttackPropertyType.None;
public BulletData(
int entityId,
int typeId,
Vector3 position,
Quaternion rotation,
Transform target,
int damage,
float speed,
AttackPropertyType attackPropertyType = AttackPropertyType.None,
float maxLifetime = 3f) : base(entityId, typeId)
{
Position = position;
Rotation = rotation;
_target = target;
_damage = damage;
_speed = speed;
_attackPropertyType = attackPropertyType;
_maxLifetime = maxLifetime;
}
public Transform Target
{
get => _target;
set => _target = value;
}
public int Damage
{
get => _damage;
set => _damage = value;
}
public float Speed
{
get => _speed;
set => _speed = value;
}
public float MaxLifetime
{
get => _maxLifetime;
set => _maxLifetime = value;
}
public AttackPropertyType AttackPropertyType
{
get => _attackPropertyType;
set => _attackPropertyType = value;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6f7248061a2a4f4f8ecf8d5db99f0a82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,26 @@
using System;
using GeometryTD.Definition;
using UnityEngine;
namespace GeometryTD.Entity.EntityData
{
[Serializable]
public class DefenseTowerData : EntityDataBase
{
[SerializeField] private DefenseTowerStatsData _stats = new DefenseTowerStatsData();
public DefenseTowerData(int entityId, int typeId, Vector3 position, Quaternion rotation, DefenseTowerStatsData stats)
: base(entityId, typeId)
{
Position = position;
Rotation = rotation;
_stats = stats ?? new DefenseTowerStatsData();
}
public DefenseTowerStatsData Stats
{
get => _stats;
set => _stats = value ?? new DefenseTowerStatsData();
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0d46035f451d4e01a5a21ed5984ce42b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: