IsoTile tile_Extrude(IsoTile _tile, Vector3 _direction, bool _bWithAttachment) { if (_tile.IsLastTile(_direction)) { _tile.coordinates.Translate(_direction); if (!_tile.IsAccumulatedTile_Collider(-_direction)) { return(_tile.Extrude(-_direction, false, _bWithAttachment)); } } return(null); }
void handle_Extrude(Vector3 _direction, SelectionType _selectionType, bool _singleAction, bool _bWithAttachment) { Vector3 _lastPos = _tile_Scene.coordinates._xyz; List <GameObject> _newTileObjects = new List <GameObject>(); IsoTile _newTile = null; if (_singleAction) { if ((_newTile = _tile_Scene.Extrude(_direction, _bWithAttachment)) != null) { _newTileObjects.Add(_newTile.gameObject); } } else { foreach (var obj in Selection.gameObjects) { if ((_newTile = obj.GetComponent <IsoTile>().Extrude(_direction, _bWithAttachment)) != null) { _newTileObjects.Add(_newTile.gameObject); } } } if (_newTileObjects.Count > 0) { Undo.IncrementCurrentGroup(); switch (_selectionType) { case SelectionType.LastTile: Selection.objects = _newTileObjects.ToArray(); break; case SelectionType.NewTile: break; case SelectionType.AllTile: Selection.objects = Selection.objects.Concat(_newTileObjects.ToArray()).ToArray(); break; } edgeUpdate(); } }