mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
725 stars 210 forks source link

Mapbox unity / Color assignment to gameobjects #1783

Closed mojtaba95 closed 3 years ago

mojtaba95 commented 3 years ago

Hi everyone,

Hope I'm in the right place to ask you about an issue.

I'm using Mapbox SDK in unity in order to do create some historical data visualization. I successfully created the visualization but now I'm facing an issue.

I want to assign colors to each of my gameobjects in the scene but my gameobjects are all connected together (they are generated automatically by tile provider) and by changing the color all the other objects change their color as well.

I wanted to know how I can give a color to each of my gameobjects before the runtime of my scene or.

Sorry if my question seems silly but I'm not an expert of unity nor c sharp.

I'll put a screenshot of my gameobjects (the administration borders between cantons)

Thanks a lot Capture d’écran 2021-05-26 153205

brnkhy commented 3 years ago

Hey @mojtaba95, Mapbox Unity SDK works only in runtime so you cannot do any coloring etc. beforehand. As a little more advanced approach, you can try coloring them by a unique property, i.e. if name is A1, color it blue etc.

mojtaba95 commented 3 years ago

Thank you so much. I'll try that to see if it works