// WL793_Probe.cs — PD 지시 #793·#794·#795 타이틀 해상도 대응 실측 (에디트 모드 · 읽기 전용) // unity command run_script --file AgentScripts/WL793_Probe.cs --entry WL793_Probe.Dump // unity command run_script --file AgentScripts/WL793_Probe.cs --entry WL793_Probe.Textures // // 왜 스크립트인가: Title.unity 51KB YAML 을 눈으로 읽어 앵커·피벗·sizeDelta 를 계산하면 오독이 난다. // CanvasScaler 의 실제 scaleFactor 는 런타임 계산식이라 YAML 만 봐서는 버튼의 "화면 픽셀 크기"가 안 나온다. // → 공개 API 로 씬을 걸어 실측한다. 쓰기 없음(SetDirty/Save 호출 없음). using System.Collections.Generic; using System.Linq; using System.Text; using UnityEditor; using UnityEngine; using UnityEngine.UI; public static class WL793_Probe { const string Out = "Screenshots_WL/title/probe_wl793.txt"; static string Rt(RectTransform r) { if (r == null) return "(RectTransform 없음)"; return string.Format( "aMin({0:F2},{1:F2}) aMax({2:F2},{3:F2}) piv({4:F2},{5:F2}) anchPos({6:F1},{7:F1}) sizeDelta({8:F1},{9:F1}) rect({10:F1}x{11:F1}) scale({12:F2},{13:F2})", r.anchorMin.x, r.anchorMin.y, r.anchorMax.x, r.anchorMax.y, r.pivot.x, r.pivot.y, r.anchoredPosition.x, r.anchoredPosition.y, r.sizeDelta.x, r.sizeDelta.y, r.rect.width, r.rect.height, r.localScale.x, r.localScale.y); } static void Walk(Transform t, int depth, StringBuilder sb) { var pad = new string(' ', depth * 2); var rt = t as RectTransform; var comps = t.GetComponents() .Where(c => c != null && !(c is Transform)) .Select(c => c.GetType().Name).ToArray(); sb.AppendLine(string.Format("{0}{1} [{2}] active={3}", pad, t.name, comps.Length == 0 ? "-" : string.Join(",", comps), t.gameObject.activeSelf)); if (rt != null) sb.AppendLine(pad + " " + Rt(rt)); var img = t.GetComponent(); if (img != null) sb.AppendLine(string.Format("{0} Image sprite={1} type={2} preserveAspect={3} raycast={4} color={5}", pad, img.sprite != null ? img.sprite.name : "(null)", img.type, img.preserveAspect, img.raycastTarget, img.color)); var raw = t.GetComponent(); if (raw != null) sb.AppendLine(string.Format("{0} RawImage tex={1} uvRect={2} raycast={3} color={4}", pad, raw.texture != null ? raw.texture.name : "(null)", raw.uvRect, raw.raycastTarget, raw.color)); var btn = t.GetComponent