经过验证发现,这是 Unity 的一个bug。当使用 Unity 非 Pro 版本时。只要在场景里加入随便脚本。然后添加 OnGUI 函数就会触发这个Bug。
如
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
}
}
经过验证发现,这是 Unity 的一个bug。当使用 Unity 非 Pro 版本时。只要在场景里加入随便脚本。然后添加 OnGUI 函数就会触发这个Bug。
如
然后反复运行该场景即可重现。
@tinytail @nantas