using System; using UnityEngine; namespace ET.Client { public static class GameObjectHelper { public static T Get(this GameObject gameObject, string key) where T : class { try { return gameObject.GetComponent().Get(key); } catch (Exception e) { throw new Exception($"获取{gameObject.name}的ReferenceCollector key失败, key: {key}", e); } } } }