Hello!
Today we found very annoying bug. It reproduces only on Windows Phone 8 device when you run it not from Visual Studio.
We created this minimalistic example:
using UnityEngine;
public class Main : MonoBehaviour {
void OnGUI()
{
if (GUI.Button(new Rect(0, 0, 500, 500), "Loop me"))
{
Debug.LogError("You click me");
int i = 0;
while (i < 0 || i < 1)
{
i++;
}
Debug.LogError("I am okay");
}
}
}
The main line here is while (i < 0 || i < 1)
This application will freeze, when you click button. Probably, this line causes infinite loop by some reason.
Instead of i < 1 you can write something another that will evaluate to True at first time(j < 10 for example).
Bytecode generated by Unity does not contain bugs, maybe it is a bug in CLR . We made similiar native Windows Phone project and everything worked fine.
Have you any ideas what causes this bug?