public static Component GetOrAddComponent(this GameObject self, Type type) { return(GameObjectUtil.GetOrAddComponent(self, type)); }
/// <summary> /// 有T返回T,没T添加T /// </summary> /// <typeparam name="T"></typeparam> /// <param name="self"></param> /// <returns></returns> public static T GetOrAddComponent <T>(this GameObject self) where T : Component { return(GameObjectUtil.GetOrAddComponent <T>(self)); }