feat: 드로그 투척 패턴 및 보스명 UI 정리
- 공통 보스 BT 프레임워크에 utility 패턴 역할과 준비/실행 브랜치를 추가 - 드로그 투척 패턴, 스킬, 투사체 이펙트를 연결하고 1인 플레이에서도 주 대상 fallback으로 발동되게 조정 - 투척 스폰 회전 계산을 보강해 zero vector 경고를 제거 - EnemyData와 VictoryUI 보스명을 투기장의 집행자 드로그 기준으로 정리 - Unity 플레이 검증으로 1인 호스트에서 투척 실행과 후속 전투 루프를 확인
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using UnityEngine;
|
||||
using Unity.Netcode;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
@@ -15,6 +17,8 @@ namespace Colosseum.Skills.Effects
|
||||
[SerializeField] private Vector3 spawnOffset = Vector3.zero;
|
||||
[SerializeField] private bool parentToCaster = false;
|
||||
[Min(0f)] [SerializeField] private float autoDestroyTime = 3f;
|
||||
[Tooltip("전투 컨텍스트의 현재 타겟을 스폰 방향 계산에 사용할지 여부")]
|
||||
[SerializeField] private bool useCombatContextTarget = false;
|
||||
|
||||
[Header("Hit Settings")]
|
||||
[Tooltip("투사체가 대상에 명중했을 때 적용할 효과. 미설정 시 명중 효과 없음.")]
|
||||
@@ -24,8 +28,9 @@ namespace Colosseum.Skills.Effects
|
||||
{
|
||||
if (prefab == null || caster == null) return;
|
||||
|
||||
Vector3 spawnPos = GetSpawnPosition(caster, target) + spawnOffset;
|
||||
Quaternion spawnRot = GetSpawnRotation(caster, target);
|
||||
GameObject resolvedTarget = ResolveTarget(caster, target);
|
||||
Vector3 spawnPos = GetSpawnPosition(caster, resolvedTarget) + spawnOffset;
|
||||
Quaternion spawnRot = GetSpawnRotation(caster, resolvedTarget);
|
||||
|
||||
var networkObject = prefab.GetComponent<NetworkObject>();
|
||||
if (networkObject != null)
|
||||
@@ -55,6 +60,20 @@ namespace Colosseum.Skills.Effects
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject ResolveTarget(GameObject caster, GameObject target)
|
||||
{
|
||||
if (!useCombatContextTarget)
|
||||
return target;
|
||||
|
||||
if (target != null && target != caster)
|
||||
return target;
|
||||
|
||||
BossCombatBehaviorContext context = caster.GetComponent<BossCombatBehaviorContext>();
|
||||
return context != null && context.CurrentTarget != null
|
||||
? context.CurrentTarget
|
||||
: target;
|
||||
}
|
||||
|
||||
private Vector3 GetSpawnPosition(GameObject caster, GameObject target)
|
||||
{
|
||||
return spawnLocation switch
|
||||
@@ -68,10 +87,13 @@ namespace Colosseum.Skills.Effects
|
||||
|
||||
private Quaternion GetSpawnRotation(GameObject caster, GameObject target)
|
||||
{
|
||||
if (spawnLocation == SpawnLocation.Target && target != null)
|
||||
if (target != null && (spawnLocation == SpawnLocation.Target || spawnLocation == SpawnLocation.CasterForward))
|
||||
{
|
||||
return Quaternion.LookRotation(target.transform.position - caster.transform.position);
|
||||
Vector3 lookDirection = target.transform.position - caster.transform.position;
|
||||
if (lookDirection.sqrMagnitude > 0.0001f)
|
||||
return Quaternion.LookRotation(lookDirection);
|
||||
}
|
||||
|
||||
return caster.transform.rotation;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user