private void DrawUnit(int x, int y) { boardGridPlaces[boardX, boardY].ChangeState(Place.PlaceState.Idle); boardGridPlaces[box1X, box1Y].ChangeState(Place.PlaceState.Idle); boardGridPlaces[box3X, box3Y].ChangeState(Place.PlaceState.Idle); boardGridPlaces[box2X, box2Y].ChangeState(Place.PlaceState.Idle); boardX = x; boardY = y; // base off of unit. var unitGridSize = 4; if (unitGridSize == 4) { // horizontal box1Y = y; box1X = ReturnBounds(x, _xLength - 1); // angle box3X = ReturnBounds(x, _xLength - 1); box3Y = ReturnBounds(y, _yLength - 1); // down box2X = x; box2Y = ReturnBounds(y, _yLength - 1); boardGridPlaces[boardX, boardY].ChangeState(Place.PlaceState.Hover); boardGridPlaces[box1X, box1Y].ChangeState(Place.PlaceState.Hover); boardGridPlaces[box3X, box3Y].ChangeState(Place.PlaceState.Hover); boardGridPlaces[box2X, box2Y].ChangeState(Place.PlaceState.Hover); } var pos = WorldUtils.GetMidPointOffset( boardGridPlaces[x, y].mouseArea.transform.position, boardGridPlaces[box3X, box3Y].mouseArea.transform.position, returnMidPoint: true ); var distance = Vector3.Distance(UnitGoInHand.transform.position, pos); if (distance > 15) { UnitGoInHand.transform.position = pos; } else { if (_moveUnitInHand != null) { LeanTween.cancel(_moveUnitInHand.id); } _moveUnitInHand = LeanTween.move(UnitGoInHand, pos, 0.5f).setEase(LeanTweenType.easeOutBack); } _listenForPlacementConfirmation = true; }