示例#1
0
    void handleOnDragStart(GameObject obj)
    {
        UnitDragDrop tempU = obj.GetComponent <UnitDragDrop>();

        if (tempU != null)
        {
            if (tempU.thisUnit != null)
            {
                cueUnit = tempU;
                cueUnit.startDrag();
                DragMoveCoord.RegisterDragStartCoord(cueUnit.thisUnit.CurrentColumn, cueUnit.thisUnit.CurrentRow);

                inputCtr.onDragging -= handleOnDragging;
                inputCtr.onDragging += handleOnDragging;
                inputCtr.onDragEnd  -= handleOnDragEnd;
                inputCtr.onDragEnd  += handleOnDragEnd;
            }


            //TODO: disable input/icons for items and settings
        }
        else
        {
            throw new System.Exception("dragging something else, not unit on board");
        }
    }
示例#2
0
    //   void Awake()
    //   {
    //       Debug.Log("im awake");
    //   }

    void Start()
    {
        UUpgrade  = GetComponent <UnitUpgrade>();
        UMerge    = GetComponent <UnitMerge>();
        UDragDrop = GetComponent <UnitDragDrop>();

        //StartDebugging();
    }
示例#3
0
    void handleOnDragEnd()
    {
        if (cueUnit)
        {
            cueUnit.stopDrag();
            cueUnit = null;
        }
        //inputCtr.onDragStart -= handleOnDragStart;
        inputCtr.onDragging -= handleOnDragging;
        //inputCtr.onDragEnd -= handleOnDragEnd;

        cdTimer.stopTimer();
        disableDragging();

        fireAllSwapsDone();
    }