[WL-814r] 전시 캐릭터 애니메이션 이벤트 에러 제거 + 이동 소요시간 프로브 (#814)
- Animator.fireEvents=false: 클립 Idle 이 쏘는 Event_Idle 의 수신자(WizardActor)를 §1 에서 떼어 내 "AnimationEvent … has no receiver!" 가 2초마다 났다(실측 6회/12초). 빈 수신자 컴포넌트를 붙이는 대신 이벤트 발사를 끈다 → Play 콘솔 error 0. - autoWalk 프로브(기본 off): 중앙→14 m 소요 시간을 실측하기 위한 씬 전용 스위치. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
4f2fdb0a86
commit
80453d64a0
|
|
@ -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;
|
||||
/// <summary>자동 전진이 목표 거리에 도달한 시각(초). 아직이면 -1.</summary>
|
||||
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<Animator>();
|
||||
|
||||
// 🔴 전시용 캐릭터에는 애니메이션 이벤트 수신자가 없다.
|
||||
// 클립 `Idle` 이 `Event_Idle` 을 쏘는데 받는 쪽(`WizardActor`)을 떼어 냈으므로
|
||||
// 루프마다 "AnimationEvent 'Event_Idle' … has no receiver!" 에러가 난다(실측 2초에 1회).
|
||||
// 빈 수신자 컴포넌트를 새로 붙이는 대신 이벤트 발사 자체를 끈다(런타임 전용 플래그).
|
||||
foreach (var a in body.GetComponentsInChildren<Animator>(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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue