Beispiel #1
0
 public DragSlot GetInSlot(DragChild dragChild)
 {
     DragSlot getSlot  = null;
     for(int i = 0;i<DragSlotGroup.Count;i++)
     {
         DragSlot C = DragSlotGroup[i];
         float dis = Vector3.Distance(dragChild.transform.position,C.transform.position);
     //			Debug.Log(dis);
         if(dis<0.1f)
         {
             getSlot = C;
             break;
         }
     }
     return getSlot;
 }
Beispiel #2
0
 //    void Awake()
 //    {
 //        GetDragParent(transform);
 //        mDragParent.DragSlotGroup.Add(this);
 //    }
 //    
 //    void GetDragParent(Transform child)
 //    {
 //        mDragParent = child.GetComponent<DragParent>();
 //        if(mDragParent == null)
 //        {
 //            GetDragParent(child.parent);
 //        }
 //    }
 public void AddDragChildToSlot(DragChild child)
 {
     mDragChild = child;
     child.mSlot = this;
 }