```
feat(gameplay): 添加建筑系统和改进摄像机控制 - 移除人类士兵数据资产文件,重构为建筑放置系统 - 在CharacterData中添加productionInterval和buildingCost字段用于建筑生产 - 实现CameraFollow脚本的完整重写,支持键盘WASD拖动、鼠标拖动、触摸拖动 - 添加摄像机缩放功能,支持上下键和触摸双指缩放 - 更新Projecttile.cs以同时处理单位和建筑目标的伤害检测 - 修改SummonCardButton从法力值召唤改为金币建筑放置模式 - 在UnitBase.cs中更新攻击逻辑以支持对建筑造成伤害 - 升级WorldHealthBar以显示建筑生产进度和更好的缩放补偿 - 修复MainCharacterDebugMovement移除键盘移动输入冲突 - 更新包管理器中的codely.bridge版本从1.0.80到1.0.81 ```
This commit is contained in:
1 parent
fb56cd7ede
commit
769aea30f3
55 files changed
+9328
-90
No files matched your search
@@ -561,12 +561,17 @@ public class UnitBase : MonoBehaviour
|
||||
private void ApplyDirectDamage(GameObject opponent)
|
||||
{
|
||||
UnitBase targetUnit = opponent.GetComponentInParent<UnitBase>();
|
||||
if (targetUnit == null || !targetUnit.ReceiveDamage(attackPower, gameObject))
|
||||
if (targetUnit != null && targetUnit.ReceiveDamage(attackPower, gameObject))
|
||||
{
|
||||
RegisterAttackHit();
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterAttackHit();
|
||||
BuildingHealth targetBuilding = opponent.GetComponentInParent<BuildingHealth>();
|
||||
if (targetBuilding != null && targetBuilding.ReceiveDamage(attackPower, gameObject))
|
||||
{
|
||||
RegisterAttackHit();
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplySkillHit(float damageMultiplier, bool registerEnergy)
|
||||
@@ -576,8 +581,17 @@ public class UnitBase : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
float damage = attackPower * Mathf.Max(0f, damageMultiplier);
|
||||
UnitBase targetUnit = target.GetComponentInParent<UnitBase>();
|
||||
if (targetUnit == null || !targetUnit.ReceiveDamage(attackPower * Mathf.Max(0f, damageMultiplier), gameObject))
|
||||
bool hit = targetUnit != null && targetUnit.ReceiveDamage(damage, gameObject);
|
||||
|
||||
if (!hit)
|
||||
{
|
||||
BuildingHealth targetBuilding = target.GetComponentInParent<BuildingHealth>();
|
||||
hit = targetBuilding != null && targetBuilding.ReceiveDamage(damage, gameObject);
|
||||
}
|
||||
|
||||
if (!hit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -621,18 +635,24 @@ public class UnitBase : MonoBehaviour
|
||||
}
|
||||
|
||||
UnitBase targetUnit = opponent.GetComponentInParent<UnitBase>();
|
||||
if (targetUnit == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
BuildingHealth targetBuilding = opponent.GetComponentInParent<BuildingHealth>();
|
||||
WorldHealthBar healthBar = targetUnit != null
|
||||
? targetUnit.GetComponent<WorldHealthBar>()
|
||||
: targetBuilding != null ? targetBuilding.GetComponent<WorldHealthBar>() : null;
|
||||
|
||||
WorldHealthBar healthBar = targetUnit.GetComponent<WorldHealthBar>();
|
||||
if (healthBar == null || !hitHealthBars.Add(healthBar))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
targetUnit.ReceiveDamage(damage, gameObject);
|
||||
if (targetUnit != null)
|
||||
{
|
||||
targetUnit.ReceiveDamage(damage, gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetBuilding.ReceiveDamage(damage, gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
if (registerEnergy)
|
||||
|
||||
Reference in new issue
Block a user