I found a very strange bug in Android build from Unity3D.
using UnityEngine;
public class Test : MonoBehaviour {
public bool inited;
void Start () {
this.inited = false; // OK!
}
void Update()
{
this.inited = true; // OK!
}
}
Yes… It’s simple and works
BUT! If I read any data from Input.location.lastData like:
using UnityEngine;
public class Test : MonoBehaviour {
public bool inited;
void Start () {
this.inited = false; // OK!
}
void Update()
{
if (this.inited && Input.location.status == LocationServiceStatus.Running)
{
float l = Input.location.lastData.latitude;
Debug.Log("TEST [l] = " + l); // OK. Data present
Debug.Log("TEST [this.inited] = " + this.inited); // !ERROR! NullReferenceException
}
}
}
then links to the class properties disappear. Any ideas?