Ejemplo n.º 1
0
        public bool RemoveCallbacks(object target, MethodInfo methodInfo, object obj)
        {
            if (!EnableBind(methodInfo, obj))
            {
                return(false);
            }

            var joint2D      = GameObjectExtensions.GetComponent <Joint2D>(obj);
            var onJointBreak = joint2D.gameObject.GetOrAddComponent <Physic2DOnJointBreakCallbacks>();

            return(BindCallbackAttribute.UnbindWithTypeAndCallbackName(target, methodInfo, onJointBreak, typeof(Physic2DOnJointBreakCallbacks), GetCallbackName()));
        }
Ejemplo n.º 2
0
        public bool AddCallbacks(object target, MethodInfo methodInfo, object obj)
        {
            if (!EnableBind(methodInfo, obj))
            {
                return(false);
            }

            var collider2D  = GameObjectExtensions.GetComponent <Collider2D>(obj);
            var onCollision = collider2D.gameObject.GetOrAddComponent <T>();

            return(BindCallbackAttribute.BindWithTypeAndCallbackName(target, methodInfo, onCollision, typeof(T), GetCallbackName()));
        }
Ejemplo n.º 3
0
 public void CreateChildren(GameObject instance, List <GameObject> outAdditionOrderList)
 {
     if (children == null)
     {
         return;
     }
     foreach (var childParam in children)
     {
         childParam.parent = instance.transform;
         GameObjectExtensions.Create(childParam, outAdditionOrderList);
     }
 }