Unity3D GUI.TextField NullReferenceException: Object reference not set to an instance of an object
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.TextEditor.ClampPos ()
UnityEngine.GUI.DoTextField (Rect position, Int32 id, UnityEngine.GUIContent content, Boolean multiline, Int32 maxLength, UnityEngine.GUIStyle style)
UnityEngine.GUI.TextField (Rect position, System.String text)
TestGUI.OnGUI () (at Assets/TestGUI.cs:37)
이미 비슷한 에러가 한번 있었는데 이번에는 GUI.TextField 쪽에서 발생하네요.
어디서 메모리 할당 안된 녀석을 참고하나 봤더니,
UnityEngine.TextEditor.ClampPos ()
UnityEngine.GUI.DoTextField (Rect position, Int32 id, UnityEngine.GUIContent content, Boolean multiline, Int32 maxLength, UnityEngine.GUIStyle style)
UnityEngine.GUI.TextField (Rect position, System.String text)
TestGUI.OnGUI () (at Assets/TestGUI.cs:37)
GCMManager.GetInstance().strGCMMsg = GUI.TextField(new Rect(0, fYpos, 300, 50), GCMManager.GetInstance().strGCMMsg);
public class GCMManager : MonoBehaviour
{
...
public string strGCMMsg;
이게 문제더군요.
public string strGCMMsg = string.Empty;
해주니 되네요.
댓글
댓글 쓰기