diff --git a/Assets/WL/Look/Arena/ArenaWalker.cs b/Assets/WL/Look/Arena/ArenaWalker.cs index 2a32a5d4b..ca02ffe9a 100644 --- a/Assets/WL/Look/Arena/ArenaWalker.cs +++ b/Assets/WL/Look/Arena/ArenaWalker.cs @@ -50,6 +50,16 @@ namespace WL.Look.Arena public string idleState = "idle"; public string runState = "run"; + [Header("프로브 — 중앙→가장자리 소요 시간 실측용 (평소 off)")] + [Tooltip("켜면 입력 없이 autoWalkDir 로 자동 전진하고, 중앙에서 autoWalkGoal m 떨어지면 걸린 시간을 로그로 남긴다.")] + public bool autoWalk; + public Vector3 autoWalkDir = Vector3.right; + public float autoWalkGoal = 14f; + + float _autoT = -1f; + /// 자동 전진이 목표 거리에 도달한 시각(초). 아직이면 -1. + public float AutoWalkSeconds { get; private set; } = -1f; + Animator _anim; Vector3 _camOffset; bool _running; @@ -59,6 +69,13 @@ namespace WL.Look.Arena if (body == null) body = transform; if (followCamera == null) followCamera = Camera.main; _anim = body.GetComponentInChildren(); + + // 🔴 전시용 캐릭터에는 애니메이션 이벤트 수신자가 없다. + // 클립 `Idle` 이 `Event_Idle` 을 쏘는데 받는 쪽(`WizardActor`)을 떼어 냈으므로 + // 루프마다 "AnimationEvent 'Event_Idle' … has no receiver!" 에러가 난다(실측 2초에 1회). + // 빈 수신자 컴포넌트를 새로 붙이는 대신 이벤트 발사 자체를 끈다(런타임 전용 플래그). + foreach (var a in body.GetComponentsInChildren(true)) a.fireEvents = false; + if (followCamera != null) _camOffset = followCamera.transform.position - body.position; SnapToGround(); PlayState(idleState); @@ -79,6 +96,16 @@ namespace WL.Look.Arena } Vector3 dir = right * Input.GetAxisRaw("Horizontal") + fwd * Input.GetAxisRaw("Vertical"); + if (autoWalk && AutoWalkSeconds < 0f) + { + if (_autoT < 0f) _autoT = Time.time; + dir = autoWalkDir; + if (DistanceFromCenter >= autoWalkGoal) + { + AutoWalkSeconds = Time.time - _autoT; + Debug.Log(string.Format("[WL-814r] 중앙→{0:F1} m 도달: {1:F2} 초 (speed {2} m/s)", autoWalkGoal, AutoWalkSeconds, moveSpeed)); + } + } if (dir.sqrMagnitude > 1f) dir.Normalize(); bool moving = dir.sqrMagnitude > 1e-4f;