It's the 15th anniversary of Google Maps Platform - Check out the latest news and announcements

Google.Maps.Util.Material.BaseMapMaterialUtils

Utility methods for constructing UnityEngine.Material instances compatible with base map features.

Summary

Public static functions

CreateUniformColoredMaterial(Color color)
UnityEngine.Material
Create a new UnityEngine.Material instance for applying a uniform color to base map features. Returns null if the necessary shaders cannot be loaded (e.g. if they were not included in the Unity project the application was built from).
FindShaderWithFallback(string name, string fallback)
Shader
Finds a shader by name; or, if that shader can't be found, logs a warning and finds a fallback shader instead.

Public static functions

CreateUniformColoredMaterial

UnityEngine.Material CreateUniformColoredMaterial(
  Color color
)

Create a new UnityEngine.Material instance for applying a uniform color to base map features. Returns null if the necessary shaders cannot be loaded (e.g. if they were not included in the Unity project the application was built from).

Details
Parameters
color
Color of material.
Returns
Base map compatible UnityEngine.Material instance with the specified color, or null if the necessary shaders cannot be loaded.

FindShaderWithFallback

Shader FindShaderWithFallback(
  string name,
  string fallback
)

Finds a shader by name; or, if that shader can't be found, logs a warning and finds a fallback shader instead.

Details
Parameters
name
Name of the shader to find.
fallback
Name of the fallback shader.
Exceptions
InvalidOperationException
If the fallback shader can't be found.