Exemplo n.º 1
0
 public override void InitParent(Object prefab, string category)
 {
     base.InitParent(prefab, category);
     rootTransform     = GameObjectUtil.GetOrNewGameObject("Pools", null).transform;
     categoryTransform = rootTransform.GetOrNewGameObject(category).transform;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 获取该gameObject下的组件,不包括剔除的组件类型
 /// </summary>
 /// <param name="self"></param>
 /// <param name="excludeComponentTypes">剔除的组件类型</param>
 /// <returns></returns>
 public static Component[] GetComponentsExclude(this GameObject self, params Type[] excludeComponentTypes)
 {
     return(GameObjectUtil.GetComponentsExclude(self, excludeComponentTypes));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 获取该gameObject下的组件,不包括剔除的组件类型
 /// </summary>
 /// <param name="self"></param>
 /// <param name="excludeComponentTypes">剔除的组件类型</param>
 /// <param name="excludeSplit"></param>
 /// <returns></returns>
 public static Component[] GetComponentsExclude(this GameObject self, string excludeComponentTypes,
                                                string excludeSplit = StringConst.String_Vertical)
 {
     return(GameObjectUtil.GetComponentsExclude(self, excludeComponentTypes, excludeSplit));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 销毁子孩子节点
 /// </summary>
 /// <param name="self"></param>
 public static void DestroyChildren(this GameObject self)
 {
     GameObjectUtil.DestroyChildren(self);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 只有包含全部的Components才会返回True
 /// </summary>
 /// <param name="self"></param>
 /// <param name="types"></param>
 /// <returns></returns>
 public static bool IsHasComponents(this GameObject self, params Type[] types)
 {
     return(GameObjectUtil.IsHasComponents(self, types));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 使某个类型的组件enable
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="enable"></param>
 public static void EnableComponents <T>(this GameObject self, bool enable) where T : MonoBehaviour
 {
     GameObjectUtil.EnableComponents <T>(self, enable);
 }
Exemplo n.º 7
0
 public static void EnableComponents(this GameObject self, Type type, bool enable)
 {
     GameObjectUtil.EnableComponents(self, type, enable);
 }
Exemplo n.º 8
0
 public static void SetPropertyValue(this GameObject self, string propertyName, object value,
                                     object[] index = null,
                                     params Type[] excludeComponentTypes)
 {
     GameObjectUtil.SetPropertyValue(self, propertyName, value, index, excludeComponentTypes);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 调用callMethod的方法
 /// </summary>
 /// <param name="c"></param>
 /// <param name="methodName"></param>
 /// <param name="excludeComponents"></param>
 /// <param name="args"></param>
 public static void Invoke(this GameObject self, string methodName, string excludeComponentTypes = null,
                           params object[] args)
 {
     GameObjectUtil.Invoke(self, methodName, excludeComponentTypes, args);
 }
Exemplo n.º 10
0
 public static T GetPropertyValue <T>(this GameObject self, string propertyName, T defaultValue,
                                      object[] index = null,
                                      params Type[] excludeComponentTypes)
 {
     return(GameObjectUtil.GetPropertyValue(self, propertyName, defaultValue, index, excludeComponentTypes));
 }
Exemplo n.º 11
0
 public static void SetFieldValue(this GameObject self, string fieldName, object value,
                                  params Type[] excludeComponentTypes)
 {
     GameObjectUtil.SetFieldValue(self, fieldName, value, excludeComponentTypes);
 }
Exemplo n.º 12
0
 public static T GetFieldValue <T>(this GameObject self, string fieldName, T defaultValue,
                                   params Type[] excludeComponentTypes)
 {
     return(GameObjectUtil.GetFieldValue <T>(self, fieldName, defaultValue, excludeComponentTypes));
 }
Exemplo n.º 13
0
 public static Component GetOrAddComponent(this GameObject self, Type type)
 {
     return(GameObjectUtil.GetOrAddComponent(self, type));
 }
Exemplo n.º 14
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));
 }