class AreaObjectBuilder
(Niantic.Lightship.Maps.Builders.Standard.Objects.AreaObjectBuilder)
Overview
An ObjectBuilderStandard used to place object instances from IAreaFeature features.
class AreaObjectBuilder: Niantic.Lightship.Maps.Builders.Standard.ObjectBuilderStandard {
public:
// methods
virtual override void Initialize(ILightshipMapView lightshipMapView);
virtual override void Release(GameObject parent);
protected:
// methods
virtual override void BuildFeature(
IMapTile mapTile,
GameObject parent,
IMapTileFeature feature
);
virtual override Vector3 GetObjectPosition(IMapTileFeature feature);
};
Inherited Members
public:
// fields
int MinLOD => _minLOD;
int MaxLOD => _maxLOD;
// properties
Guid Id;
int MinLOD;
int MaxLOD;
Guid Id;
// methods
virtual void Initialize(ILightshipMapView lightshipMapView);
GameObject CreateParent(IMapTileObject mapTileObject);
void Release(GameObject parent);
GameObject CreateParent(IMapTileObject mapTileObject);
virtual abstract void Release(GameObject parent) = 0;
void Build(IMapTile mapTile, GameObject parent);
virtual void Build(IMapTile mapTile, GameObject parent);
```cs
protected:
// fields
string BuilderName => _builderName.NullIfEmptyOrWhitespace() ?? name;
LayerKind Layer => _mapLayer;
List<FeatureKind> Features => _features;
// properties
Vector3 ZOffset;
// methods
virtual abstract void BuildFeature(
IMapTile mapTile,
GameObject parent,
IMapTileFeature feature
) = 0;
virtual Vector3 GetObjectPosition(IMapTileFeature feature);
virtual Quaternion GetObjectRotation(IMapTileFeature feature);
virtual Vector3 GetObjectScale(IMapTileFeature feature);
Detailed Documentation
An ObjectBuilderStandard used to place object instances from IAreaFeature features.
Methods
Initialize
virtual override void Initialize(ILightshipMapView lightshipMapView)
Builders may optionally implement this method if they need to perform any initialization or might need access to their parent ILightshipMapView instance later on.
Release
virtual override void Release(GameObject parent)
Called when a maptile is removed from the scene. This method cleans up objects or other resources created when the maptile is built by this builder.
BuildFeature
virtual override void BuildFeature(
IMapTile mapTile,
GameObject parent,
IMapTileFeature feature
)
Called by the Build
method for each IMapTileFeature that matches the builder's LayerKind and FeatureKinds.
GetObjectPosition
virtual override Vector3 GetObjectPosition(IMapTileFeature feature)
Gets an instantiated object's local position. This method should be overridden when customizing the position of placed object instances.