[TASK] Initial commit with basic product setup
This commit is contained in:
55
Assets/Mapbox SDK/Mapbox/Unity/SourceLayers/AbstractLayer.cs
Normal file
55
Assets/Mapbox SDK/Mapbox/Unity/SourceLayers/AbstractLayer.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
namespace Mapbox.Unity.Map
|
||||
{
|
||||
using Mapbox.Unity.MeshGeneration.Factories;
|
||||
using Mapbox.Unity.MeshGeneration.Interfaces;
|
||||
using Mapbox.Unity.MeshGeneration.Modifiers;
|
||||
|
||||
public class LayerUpdateArgs : System.EventArgs
|
||||
{
|
||||
public AbstractTileFactory factory;
|
||||
public MapboxDataProperty property;
|
||||
public bool effectsVectorLayer;
|
||||
}
|
||||
|
||||
public class VectorLayerUpdateArgs : LayerUpdateArgs
|
||||
{
|
||||
public LayerVisualizerBase visualizer;
|
||||
public ModifierBase modifier;
|
||||
}
|
||||
|
||||
public class AbstractLayer
|
||||
{
|
||||
public event System.EventHandler UpdateLayer;
|
||||
protected virtual void NotifyUpdateLayer(LayerUpdateArgs layerUpdateArgs)
|
||||
{
|
||||
System.EventHandler handler = UpdateLayer;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, layerUpdateArgs);
|
||||
}
|
||||
}
|
||||
protected virtual void NotifyUpdateLayer(AbstractTileFactory factory, MapboxDataProperty prop, bool effectsVectorLayer = false)
|
||||
{
|
||||
System.EventHandler handler = UpdateLayer;
|
||||
if (handler != null)
|
||||
{
|
||||
LayerUpdateArgs layerUpdateArgs =
|
||||
(factory is VectorTileFactory) ?
|
||||
new VectorLayerUpdateArgs
|
||||
{
|
||||
factory = factory,
|
||||
effectsVectorLayer = effectsVectorLayer,
|
||||
property = prop
|
||||
}
|
||||
:
|
||||
new LayerUpdateArgs
|
||||
{
|
||||
factory = factory,
|
||||
effectsVectorLayer = effectsVectorLayer,
|
||||
property = prop
|
||||
};
|
||||
handler(this, layerUpdateArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user