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"); } }
// void Awake() // { // Debug.Log("im awake"); // } void Start() { UUpgrade = GetComponent <UnitUpgrade>(); UMerge = GetComponent <UnitMerge>(); UDragDrop = GetComponent <UnitDragDrop>(); //StartDebugging(); }
void handleOnDragEnd() { if (cueUnit) { cueUnit.stopDrag(); cueUnit = null; } //inputCtr.onDragStart -= handleOnDragStart; inputCtr.onDragging -= handleOnDragging; //inputCtr.onDragEnd -= handleOnDragEnd; cdTimer.stopTimer(); disableDragging(); fireAllSwapsDone(); }