// WL920_Probe.cs — PD 지시 #920 시험(Play 중 · 섬) // Sword(seconds) : 검 각성(Skill_DashSlash) 발동 — 투사체가 켜진 순간 기준으로 베기 그림(stab01~07)이 처음 보인 시각 · 이펙트가 꺼진 시각 · 명중 시각 · 동작(클립) 바뀐 시각 // Equip() : 지금 장착(부위별 아이템 이름) using System.Text; using UnityEngine; public static class WL920_Probe { const string Key = "wl920log"; static StringBuilder Buf() { var sb = System.AppDomain.CurrentDomain.GetData(Key) as StringBuilder; if (sb == null) { sb = new StringBuilder(); System.AppDomain.CurrentDomain.SetData(Key, sb); } return sb; } public static object Log() { return Buf().ToString(); } static float s_t0 = -1f; static StringBuilder s_hits = new StringBuilder(); static int s_n; static void OnHit(in WL.Combat.Core.HitConfirmedEvent e) { var pd = e.projectile; if (pd == null || pd.m_SkillListTableData == null || pd.m_SkillListTableData.e_Skill.ToString() != "Skill_DashSlash") return; s_n++; s_hits.Append(s_t0 >= 0f ? (Time.time - s_t0).ToString("F2") : "?").Append(' '); } public static object Sword(float seconds) { var pc = MyValue.MyPC as PCActor; if (pc == null) return "PC 없음"; var sb = Buf(); sb.Length = 0; s_hits.Length = 0; s_n = 0; s_t0 = -1f; WL.Combat.Core.CombatEvents.HitConfirmed.Remove(OnHit); WL.Combat.Core.CombatEvents.HitConfirmed.Add(OnHit); float tc = Time.time; var seen = new System.Collections.Generic.HashSet(); bool fxOn = false; string lastClip = ""; UnityEngine.Events.UnityAction act = null; act = () => { float now = Time.time; GameObject fx = null; foreach (var s in Object.FindObjectsByType(FindObjectsInactive.Exclude, FindObjectsSortMode.None)) { if (s == null) continue; var f = s.transform.Find("FX_7Blue Stab"); if (s_t0 < 0f) { s_t0 = now; sb.AppendFormat("발동 뒤 {0:F2} 초에 투사체 켜짐(=0)", now - tc).Append('\n'); } if (f != null) fx = f.gameObject; } float t = s_t0 >= 0f ? now - s_t0 : -1f; var ci = pc.m_animation != null ? pc.m_animation.GetCurrentAnimatorClipInfo(0) : null; string clip = ci != null && ci.Length > 0 && ci[0].clip != null ? ci[0].clip.name : "-"; if (clip != lastClip && s_t0 >= 0f) { lastClip = clip; sb.AppendFormat("{0:F2} 동작 {1} ({2})", t, clip, pc.Get_CurAnim()).Append('\n'); } if (fx != null && fx.activeInHierarchy) { if (!fxOn) { fxOn = true; sb.AppendFormat("{0:F2} 이펙트 켜짐", t).Append('\n'); } var root = fx.transform.Find("Particle System"); if (root != null) foreach (Transform c in root) { if (!c.name.StartsWith("stab") || seen.Contains(c.name)) continue; int n = 0; foreach (var ps in c.GetComponentsInChildren(false)) if (ps.transform != c && (ps.name == "head" || ps.name == "blue_flash" || ps.name == "Trail")) n += ps.particleCount; // 찌르기 모양(지연 있는 자식)만 — stabNN 자체는 0 초에 방출 if (n > 0) { seen.Add(c.name); sb.AppendFormat("{0:F2} {1} 보임", t, c.name).Append('\n'); } } } else if (fxOn) { fxOn = false; sb.AppendFormat("{0:F2} 이펙트 꺼짐", t).Append('\n'); } if (now - tc > seconds) { Application.onBeforeRender -= act; WL.Combat.Core.CombatEvents.HitConfirmed.Remove(OnHit); sb.Append("명중 ").Append(s_n).Append("회 · 시각 ").Append(s_hits).Append('\n'); } }; Application.onBeforeRender += act; return "slot2: " + WL.Combat.Weapon.WLSkillHotkey.Fire(2); } public static object Equip() { var sb = new StringBuilder(); if (!WL.Equip.WLInventory.EnsureLoaded()) return "인벤토리 준비 안 됨"; foreach (var it in WL.Equip.WLInventory.SortedItems()) if (it != null && it.itemJson != null && WL.Equip.WLInventory.IsEquipped(it.rawItem._id)) sb.Append(it.itemJson.GroupNo).Append(' ').Append(it.itemJson.Item_name).Append(" · "); return sb.Length > 0 ? sb.ToString() : "장착 없음"; } }