Skip to main content

class LayerMonoBehaviourPlacement

(Niantic.Lightship.Maps.MapLayers.Components.BaseTypes.LayerMonoBehaviourPlacement)

Overview

Base class for MapLayerComponent s that instantiate MonoBehaviours from a given prefab.

    template <T>
class LayerMonoBehaviourPlacement: Niantic.Lightship.Maps.MapLayers.Components.BaseTypes.LayerPrefabPlacementBase {
protected:
// methods

virtual override Transform GetTransform(T instance);
virtual override GameObject GetGameObject(T instance);
};

Inherited Members

public:
// methods

virtual void Initialize(LightshipMapView lightshipMapView, GameObject parent);
virtual abstract void OnMapOriginChanged() = 0;
PooledObject<T> PlaceInstance(in LatLng position, string instanceName = null);

virtual PooledObject<T> PlaceInstance(
in LatLng position,
in Quaternion rotation,
string instanceName = null
);

PooledObject<T> PlaceInstance(in Vector3 position, string instanceName = null);

PooledObject<T> PlaceInstance(
in Vector3 position,
in Quaternion rotation,
string instanceName = null
);

virtual override void Initialize(
LightshipMapView lightshipMapView,
GameObject parent
);

virtual override void OnMapOriginChanged();

```cs
protected:
// fields

LightshipMapView LightshipMapView;
GameObject ParentMapLayer;

// methods

virtual abstract Transform GetTransform(T instance) = 0;
virtual abstract GameObject GetGameObject(T instance) = 0;
virtual void OnObjectPoolAcquire(PooledObject<T> pooledObject);
virtual void OnObjectPoolRelease(T instance);
virtual Vector3 GetObjectScale(double mapRadius);
virtual Quaternion GetObjectRotation(in Quaternion rotation);
virtual Vector3 GetObjectPosition(in LatLng location);

Detailed Documentation

Base class for MapLayerComponent s that instantiate MonoBehaviours from a given prefab.

    Parameters:

    T - The MonoBehaviour's type

Methods

GetTransform

virtual override Transform GetTransform(T instance)

Classes derived from LayerPrefabPlacementBase<T> should implement this method by returning the Transform of an object placed by that derived class.

GetGameObject

virtual override GameObject GetGameObject(T instance)

Classes derived from LayerPrefabPlacementBase<T> should implement this method by returning the GameObject of an object placed by that derived class.