Files
Colosseum/Assets/_Game/Scripts/Debug/FacingDirectionGizmoUtility.cs
dal4segno 8c08e63c81 fix: 드로그 기본기3 시작 루트모션과 추적 보정 정리
- 기본기3 시작 프레임의 수평 루트모션 스냅을 차단하고 정면 투영/접촉 정지 거리 보정을 정리
- 스킬 완료 판정과 시작 타깃 정렬 로직을 보강하고 드로그/플레이어 정면 및 시작점 디버그 gizmo를 추가
- 드로그 기본기3 관련 애니메이션·패턴·스킬 자산을 재정리하고 Blender 보조 스크립트를 추가
2026-04-17 09:56:40 +09:00

45 lines
1.9 KiB
C#

using UnityEngine;
namespace Colosseum.Debugging
{
/// <summary>
/// 씬 뷰에서 캐릭터의 정면 방향을 화살표로 표시하는 Gizmo 유틸리티입니다.
/// </summary>
public static class FacingDirectionGizmoUtility
{
/// <summary>
/// 지정한 Transform의 정면 방향 화살표를 그립니다.
/// </summary>
public static void DrawFacingArrow(Transform targetTransform, Color color, float length = 1.6f, float headLength = 0.35f, float headWidth = 0.22f, float heightOffset = 0.1f, float shaftThickness = 0.08f)
{
if (targetTransform == null)
return;
Vector3 origin = targetTransform.position + Vector3.up * heightOffset;
Vector3 forward = targetTransform.forward.normalized;
if (forward.sqrMagnitude <= 0.0001f)
return;
Vector3 tip = origin + forward * length;
Vector3 right = targetTransform.right.normalized;
Vector3 up = targetTransform.up.normalized;
Vector3 headBase = tip - forward * headLength;
Vector3 rightOffset = right * shaftThickness;
Vector3 upOffset = up * shaftThickness;
Gizmos.color = color;
Gizmos.DrawLine(origin, tip);
Gizmos.DrawLine(origin + rightOffset, tip + rightOffset);
Gizmos.DrawLine(origin - rightOffset, tip - rightOffset);
Gizmos.DrawLine(origin + upOffset, tip + upOffset);
Gizmos.DrawLine(origin - upOffset, tip - upOffset);
Gizmos.DrawLine(tip, headBase + right * headWidth);
Gizmos.DrawLine(tip, headBase - right * headWidth);
Gizmos.DrawLine(tip, headBase + up * headWidth * 0.7f);
Gizmos.DrawLine(tip, headBase - up * headWidth * 0.7f);
Gizmos.DrawSphere(origin, shaftThickness * 0.55f);
Gizmos.DrawSphere(tip, shaftThickness * 0.65f);
}
}
}