public void DragComponent_OnMouseUp(DragAreaTypes dragAreaTypes)
    {
        switch (dragAreaTypes)
        {
        case DragAreaTypes.Bag:
        {
            if (!isReturningToBag)
            {
                bool suc = ReturnToBag(false, false);
                if (!suc)
                {
                    DragManager.Instance.CurrentDrag.ReturnOriginalPositionRotation();
                }
            }

            break;
        }

        case DragAreaTypes.MechaEditorArea:
        {
            break;
        }

        case DragAreaTypes.None:
        {
            bool suc = ReturnToBag(false, false);
            if (!suc)
            {
                DragManager.Instance.CurrentDrag.ReturnOriginalPositionRotation();
            }

            break;
        }
        }
    }
Esempio n. 2
0
 public void DragComponent_OnMouseUp(DragAreaTypes dragAreaTypes)
 {
     BagManager.Instance.RemoveMechaComponentFromBag(this, false);
     if (dragAreaTypes == DragAreaTypes.Bag)
     {
         bool suc = BagManager.Instance.AddMechaComponentToBag(MechaComponentInfo, GridPos.orientation, RealPositionsInBagPanel, out BagItem _);
         if (!suc)
         {
             BagManager.Instance.AddMechaComponentToBag(MechaComponentInfo, GridPos_BeforeMove.orientation, RealPositionsInBagPanel_BeforeMove, out BagItem _);
         }
     }
 }
Esempio n. 3
0
    public void DragComponent_OnMousePressed(DragAreaTypes dragAreaTypes)
    {
        switch (dragAreaTypes)
        {
        case DragAreaTypes.Bag:
        {
            if (Input.GetKeyUp(KeyCode.R))
            {
                Rotate();
            }

            RefreshPreviewGridPositions();
            break;
        }
        }
    }
    public void DragComponent_OnMousePressed(DragAreaTypes dragAreaTypes)
    {
        if (Input.GetKeyUp(KeyCode.R))
        {
            Rotate();
        }

        switch (dragAreaTypes)
        {
        case DragAreaTypes.Bag:
        {
            ReturnToBag(true, true);
            break;
        }
        }

        if (ParentMecha && ParentMecha.MechaInfo.MechaType == MechaType.Self)
        {
            GridPos gridPos = GridPos.GetGridPosByMousePos(ParentMecha.transform, Vector3.up, GameManager.GridSize);
            gridPos.orientation = MechaComponentInfo.GridPos.orientation;
            SetGridPosition(gridPos);
        }
    }
 public void DragComponent_SetStates(ref bool canDrag, ref DragAreaTypes dragFrom)
 {
     canDrag  = true;
     dragFrom = DragAreaTypes.MechaEditorArea;
 }