Topic: Broken script after last update
Hi
I updated Online maps this morning (that haven't been done since more than a month) and i got an error spamming my console (and making the app really slow) on a custom script, which purpose is to check the downloaded tiles.
Here is the script :
using UnityEngine;
public class CheckArcGISTile : MonoBehaviour
{
private Color emptyColor = new Color32(204, 204, 204, 255);
private void Start()
{
OnlineMapsTileManager.OnTileLoaded += OnTileLoaded;
}
private void OnTileLoaded(OnlineMapsTile tile)
{
Texture2D texture = tile.texture;
Color c1 = texture.GetPixel(1, 1); // new error is here
Color c2 = texture.GetPixel(254, 254);
if (c1 == emptyColor && c2 == emptyColor) tile.status = OnlineMapsTileStatus.error;
}
}
Error is on line 15. When disabling this script, the app doesn't get slowed.
error is "null reference exeption: object not set to an instance of an object ..."
So i guess things have change since july about the tile loading, what is the new way of doing this correctly ?
Thanks for your help
Thibault