Topic: How can I choose which marker to use via script?
HI!
Whenever I add a marker via script, It only shows the green marker. how can I choose which marker to choose via script?
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → How can I choose which marker to use via script?
HI!
Whenever I add a marker via script, It only shows the green marker. how can I choose which marker to choose via script?
Hello.
OnlineMaps.AddMarker has a parameter markerTexture.
Use this parameter to specify the marker texture.
http://infinity-code.com/doxygen/online … fa6fad9ee8
Hi again!
Am I using it right?
marker = OnlineMaps.instance.AddMarker(getPosition(), myNewMarker.png, "Player");
And should I put the myNewMarker.png in the folder with the defaultmarker.png?
Thanks Alex!
No.
It should be:
// Must have "Read / Write enabled - ON".
public Texture2D myMarkerTexture;
void SomeMethod()
{
marker = OnlineMaps.instance.AddMarker(getPosition(), myMarkerTexture, "Player");
}You specify the texture of the marker in the inspector.
If you want to dynamically load texture, use Resources.Load.
https://docs.unity3d.com/ScriptReferenc … .Load.html
Infinity Code Forum → Online Maps Help → How can I choose which marker to use via script?
Powered by PunBB, supported by Informer Technologies, Inc.