コード例 #1
0
 public static Component GetOrAddComponent(this GameObject self, Type type)
 {
     return(GameObjectUtil.GetOrAddComponent(self, type));
 }
コード例 #2
0
 /// <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));
 }