feat: 채널링 빔 스킬 시스템 구현 및 PolygonParticleFX VFX 에셋 추가
- SkillData: 채널링 필드 추가 (지속시간, 틱 간격, 틱/종료 효과, VFX 프리팹, 마운트 경로, 크기 배율) - SkillController: 채널링 상태 관리 (Start/Update/End), VFX 생성/파괴, 틱 효과 주기 발동, 버튼 해제로 중단 - SkillEffect: Beam(원통) 범위 판정 추가 (OverlapCapsule), 디버그 시각화 - PlayerSkillInput: 스킬 취소(canceled) 이벤트 구독 → 채널링 중단 통지 - SkillLoadoutEntry: 채널링 틱/종료 효과 수집 메서드 추가 - 스킬 데이터/이펙트/애니메이션/VFX 에셋 추가 (채널링 스킬용) - PolygonParticleFX VFX 에셋 패키지 추가 (Materials, Models, Prefabs, Textures, Scenes)
This commit is contained in:
@@ -144,6 +144,15 @@ namespace Colosseum.Skills
|
||||
|
||||
private void CollectAreaTargets(GameObject caster, List<GameObject> destination, Vector3? groundPosition = null)
|
||||
{
|
||||
switch (areaShape)
|
||||
{
|
||||
case AreaShapeType.Beam:
|
||||
CollectBeamTargets(caster, destination);
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Vector3 center = GetAreaCenter(caster, groundPosition);
|
||||
Collider[] hits = Physics.OverlapSphere(center, Mathf.Max(areaRadius, fanRadius), targetLayers);
|
||||
foreach (var hit in hits)
|
||||
@@ -161,6 +170,31 @@ namespace Colosseum.Skills
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 빔(원통) 범위 내 타겟을 수집합니다.
|
||||
/// 시전자 정면 fanOriginDistance 위치에서 areaRadius 길이의 원통을 판정합니다.
|
||||
/// </summary>
|
||||
private void CollectBeamTargets(GameObject caster, List<GameObject> destination)
|
||||
{
|
||||
Vector3 casterPos = caster.transform.position;
|
||||
Vector3 forward = caster.transform.forward;
|
||||
float beamLength = Mathf.Max(areaRadius, 0.1f);
|
||||
float beamRadius = Mathf.Max(fanRadius, 0.1f);
|
||||
float startOffset = Mathf.Max(fanOriginDistance, 0f);
|
||||
|
||||
Vector3 origin = casterPos + forward * startOffset;
|
||||
Vector3 point1 = origin + forward * beamRadius;
|
||||
Vector3 point2 = origin + forward * (beamLength - beamRadius);
|
||||
|
||||
Collider[] hits = Physics.OverlapCapsule(point1, point2, beamRadius, targetLayers);
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
if (!includeCasterInArea && hit.gameObject == caster) continue;
|
||||
if (!IsCorrectTeam(caster, hit.gameObject)) continue;
|
||||
AddUniqueTarget(destination, hit.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddUniqueTarget(List<GameObject> destination, GameObject target)
|
||||
{
|
||||
if (target == null || destination.Contains(target))
|
||||
@@ -232,6 +266,10 @@ namespace Colosseum.Skills
|
||||
? (center - casterPos).normalized
|
||||
: forward, fanOriginDistance, fanRadius, fanHalfAngle, Color.red, duration);
|
||||
}
|
||||
else if (areaShape == AreaShapeType.Beam)
|
||||
{
|
||||
DebugDrawBeam(casterPos, forward, areaRadius, fanRadius, fanOriginDistance, Color.red, duration);
|
||||
}
|
||||
}
|
||||
|
||||
private void DebugDrawSphere(Vector3 center, float radius, Color color, float duration)
|
||||
@@ -287,6 +325,51 @@ namespace Colosseum.Skills
|
||||
// 원점 표시
|
||||
Debug.DrawLine(fanOrigin + Vector3.up * 0.1f, fanOrigin + Vector3.up * 1.5f, color, duration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 빔(원통) 범위를 디버그 시각화합니다.
|
||||
/// 시전자 정면 startOffset 위치에서 사거리만큼의 원통과 단면 원을 그립니다.
|
||||
/// </summary>
|
||||
private void DebugDrawBeam(Vector3 casterPos, Vector3 forward, float beamLength, float beamRadius, float startOffset, Color color, float duration)
|
||||
{
|
||||
Vector3 origin = casterPos + forward * startOffset;
|
||||
Vector3 end = origin + forward * beamLength;
|
||||
int segments = 16;
|
||||
float step = 360f / segments;
|
||||
|
||||
// 시작 단면 원
|
||||
Vector3 prevStart = origin + new Vector3(beamRadius, 0, 0);
|
||||
for (int i = 1; i <= segments; i++)
|
||||
{
|
||||
float angle = i * step * Mathf.Deg2Rad;
|
||||
Vector3 next = origin + new Vector3(Mathf.Cos(angle) * beamRadius, 0, Mathf.Sin(angle) * beamRadius);
|
||||
Debug.DrawLine(prevStart, next, color, duration);
|
||||
prevStart = next;
|
||||
}
|
||||
|
||||
// 끝 단면 원
|
||||
Vector3 prevEnd = end + new Vector3(beamRadius, 0, 0);
|
||||
for (int i = 1; i <= segments; i++)
|
||||
{
|
||||
float angle = i * step * Mathf.Deg2Rad;
|
||||
Vector3 next = end + new Vector3(Mathf.Cos(angle) * beamRadius, 0, Mathf.Sin(angle) * beamRadius);
|
||||
Debug.DrawLine(prevEnd, next, color, duration);
|
||||
prevEnd = next;
|
||||
}
|
||||
|
||||
// 네 모서리 연결선
|
||||
Debug.DrawLine(origin + forward * 0 + new Vector3(beamRadius, 0, 0), end + new Vector3(beamRadius, 0, 0), color, duration);
|
||||
Debug.DrawLine(origin + new Vector3(-beamRadius, 0, 0), end + new Vector3(-beamRadius, 0, 0), color, duration);
|
||||
Debug.DrawLine(origin + new Vector3(0, 0, beamRadius), end + new Vector3(0, 0, beamRadius), color, duration);
|
||||
Debug.DrawLine(origin + new Vector3(0, 0, -beamRadius), end + new Vector3(0, 0, -beamRadius), color, duration);
|
||||
|
||||
// 중심선
|
||||
Debug.DrawLine(origin, end, color, duration);
|
||||
|
||||
// 높이 표시
|
||||
Debug.DrawLine(origin + Vector3.up * 0.1f, origin + Vector3.up * 1.5f, color, duration);
|
||||
Debug.DrawLine(end + Vector3.up * 0.1f, end + Vector3.up * 1.5f, color, duration);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -314,6 +397,7 @@ namespace Colosseum.Skills
|
||||
public enum AreaShapeType
|
||||
{
|
||||
Sphere, // 원형 범위
|
||||
Fan // 부채꼴 범위
|
||||
Fan, // 부채꼴 범위
|
||||
Beam // 원통 범위 (areaRadius=사거리, fanRadius=빔 폭)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user