using System.Text; using UnityEngine; using UnityEngine.SceneManagement; public static class InspectTownSquare { public static string Run() { var sb = new StringBuilder(); var root = GameObject.Find("TownSquare"); if (root == null) return "no TownSquare"; foreach (Transform t in root.transform) { var b = default(Bounds); var has = false; foreach (var r in t.GetComponentsInChildren()) { if (!has) { b = r.bounds; has = true; } else b.Encapsulate(r.bounds); } var cols = t.GetComponentsInChildren().Length; sb.AppendFormat( "{0} pos={1} euler={2} scale={3} boundsC={4} size={5} meshCol={6}\n", t.name, t.position, t.eulerAngles, t.localScale, has ? b.center : Vector3.zero, has ? b.size : Vector3.zero, cols); } return sb.ToString(); } }