完整启动流程
This commit is contained in:
@@ -51,7 +51,25 @@ namespace BaseGames.Combat
|
||||
gameObject.layer = (ownerLayer == playerLayer) ? playerProjLayer : enemyProjLayer;
|
||||
}
|
||||
|
||||
/// <summary>子类在此设定初速度或附加初始化逻辑。</summary>
|
||||
/// <summary>
|
||||
/// 弹反:将投射物阵营从 EnemyProjectile 切换为 PlayerProjectile。
|
||||
/// 反转飞行方向,并重置 HitBox 命中记录使其能够命中新目标(敌人)。
|
||||
/// 由 HurtBox.ReceiveDamage() 在弹反成功后调用。
|
||||
/// </summary>
|
||||
public virtual void ReflectAsPlayerProjectile()
|
||||
{
|
||||
int playerProjLayer = LayerMask.NameToLayer("PlayerProjectile");
|
||||
if (playerProjLayer < 0) return;
|
||||
|
||||
gameObject.layer = playerProjLayer;
|
||||
Direction = -Direction;
|
||||
_rb.velocity = -_rb.velocity;
|
||||
|
||||
// 重置 HitBox 命中记录,确保反射后可命中新目标
|
||||
_hitBox.Deactivate();
|
||||
_hitBox.Activate(_config?.DamageSource);
|
||||
}
|
||||
|
||||
protected virtual void OnInitialized() { }
|
||||
|
||||
protected virtual void Update()
|
||||
|
||||
Reference in New Issue
Block a user