Exemplo n.º 1
0
    void OnRecieve(GUIDragHandler.DragDatas recieverData, GUIDragHandler.DragDatas dragData)
    {
        try
        {
            GM.BundleInfo recieverItem = mCurrentRecieving;
            if (recieverItem == null)
            {
                return;
            }

            List <GM.BundleInfo> dragItems = dragData.customDragData as List <GM.BundleInfo>;

            List <GM.BundleInfo> tmpList = mCurrentEditItems;
            mCurrentEditItems = null;
            foreach (GM.BundleInfo _desc in dragItems)
            {
                tmpList.Remove(_desc);
            }

            int _idx = tmpList.IndexOf(recieverItem);
            tmpList.InsertRange(_idx, dragItems);
            mCurrentEditItems = tmpList;
            tmpList           = null;

            mCurrentEditItemsChanged = true;

            //SaveBundleShipInfoFile();

            Repaint();
        }
        catch (System.Exception ex)
        {
            Debug.LogError(ex.ToString());
        }
    }
Exemplo n.º 2
0
 bool OnCanRecieve(GUIDragHandler.DragDatas revieverData, GUIDragHandler.DragDatas dragData)
 {
     try
     {
         List <GM.BundleInfo> dragItems = dragData.customDragData as List <GM.BundleInfo>;
         if (mCurrentRecieving != null)
         {
             if (dragItems.Contains(mCurrentRecieving))
             {
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(true);
         }
     }
     catch (System.Exception ex)
     {
         Debug.LogError(ex.ToString());
     }
     return(false);
 }
Exemplo n.º 3
0
 void OnRecieve(GUIDragHandler.DragDatas recieverData, GUIDragHandler.DragDatas dragData)
 {
     if (dragData.customDragData == null && dragData.dragPaths.Length != 0)
     {
         foreach (string dragPath in dragData.dragPaths)
         {
             if (dragPath == null)
             {
                 continue;
             }
             if (BundleManager.CanAddPathToBundle(dragPath, (string)recieverData.customDragData))
             {
                 BundleManager.AddPathToBundle(dragPath, (string)recieverData.customDragData);
             }
         }
     }
     else
     {
         BundleManager.SetParent((string)dragData.customDragData, (string)recieverData.customDragData);
     }
 }
Exemplo n.º 4
0
    bool OnCanRecieve(GUIDragHandler.DragDatas recieverData, GUIDragHandler.DragDatas dragData)
    {
        if (dragData.customDragData == null && dragData.dragPaths.Length != 0)
        {
            foreach (string dragPath in dragData.dragPaths)
            {
                if (dragPath == null)
                {
                    continue;
                }

                if (BundleManager.CanAddPathToBundle(dragPath, (string)recieverData.customDragData))
                {
                    return(true);
                }
            }

            return(false);
        }
        else
        {
            return(BundleManager.CanBundleParentTo((string)dragData.customDragData, (string)recieverData.customDragData));
        }
    }