public void cancelMovement() { if (selectUnitX >= 0 && selectUnitY >= 0) { var unit = UnitPlacement [selectUnitX, selectUnitY]; GameUnit unitStat = (GameUnit)unit.GetComponent("GameUnit"); if (hasCancelTransform) { unit.transform.position = unitCancelTransform; hasCancelTransform = false; } unitStat.CancelMovement(); //Resets selection targetTileX = selectUnitX = selectTileX = -1; targetTileY = selectUnitY = selectTileY = -1; UnitMovementController.fullclear(); PlayMap.LockMovement = false; PlayMap.UnitMenu.SetActive(false); PlayMap.HideAttackInfo(); } }