public void MoveAndSpawn(int x, int y) { map.selectedUnit.GetComponent <Unit>().tileX = x; map.selectedUnit.GetComponent <Unit>().tileY = y; map.selectedUnit.transform.position = map.TileCoordToWorldCoord(x, y); map.counterIncrease(); map.SpawnMon(); }