protected virtual void SetupTile(PlacedWorldTileTypeSO _placedWorldTileTypeSO, Vector2Int origin, PlacedObjectTypeSO.Dir dir) { this.placedWorldTileTypeSO = _placedWorldTileTypeSO; this.origin = origin; this.dir = dir; }
public static PlacedObject_WorldTile Create(Transform _worldTileParent, List <TileAspect> _startingAspects, Vector3 worldPosition, Vector2Int origin, PlacedWorldTileTypeSO.Dir dir, PlacedWorldTileTypeSO _placedWorldTileTypeSO) { Transform placedObjectTransform = Instantiate(_placedWorldTileTypeSO.prefab, worldPosition, Quaternion.Euler(0, _placedWorldTileTypeSO.GetRotationAngle(dir), 0), _worldTileParent); PlacedObject_WorldTile placedObject = placedObjectTransform.GetComponent <PlacedObject_WorldTile>(); placedObject.SetupTile(_placedWorldTileTypeSO, origin, dir); placedObject.SetTileAspects(_startingAspects); return(placedObject); }