You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mapbox-sdk/Unity/SourceLayers/SubLayerColorStyle.cs

45 lines
810 B

namespace Mapbox.Unity.Map
{
using UnityEngine;
public class SubLayerColorStyle : ISubLayerColorStyle
{
private GeometryMaterialOptions _materialOptions;
public SubLayerColorStyle(GeometryMaterialOptions materialOptions)
{
_materialOptions = materialOptions;
}
public Color FeatureColor
{
get
{
return _materialOptions.colorStyleColor;
}
set
{
if (_materialOptions.colorStyleColor != value)
{
_materialOptions.colorStyleColor = value;
_materialOptions.HasChanged = true;
}
}
}
public void SetAsStyle()
{
SetAsStyle(Color.white);
}
public void SetAsStyle(Color featureColor)
{
_materialOptions.style = StyleTypes.Color;
_materialOptions.colorStyleColor = featureColor;
_materialOptions.HasChanged = true;
}
}
}