Author Topic: ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()  (Read 6449 times)

peterworth

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Hi, my project was working fine, i don't *think* i changed anything, but have suddenly started getting a few of these errors at runtime:

ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()

followed by:

NullReferenceException
UnityEngine.Material..ctor (UnityEngine.Shader shader)
UIDrawCall.CreateMaterial () (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:329)
UIDrawCall.RebuildMaterial () (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:345)
UIDrawCall.UpdateMaterials () (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:365)
UIDrawCall.UpdateGeometry (Int32 widgetCount) (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:502)
UIPanel.FillAllDrawCalls () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1343)
UIPanel.UpdateSelf () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1227)
UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:1181)

This is with ngui 3.7.5 and unity 4.5.5f1

It seems to be something to do with my UITextures and UILabels having material set to 'none'? but this hasn't caused any problems before.

I'm not sure how to start debugging this. It seems to happen with all scenes with ngui in. I tried reimporting all assets, and also deleting and reimporting ngui.

Thanks for any pointers.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()
« Reply #1 on: November 02, 2014, 03:12:41 AM »
Line 329 of UIDrawCall is a bracket for me, so that doesn't tell me much... And can't say I've seen this before.

peterworth

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: ms_IDToPointer->find (obj->GetInstanceID ()) == ms_IDToPointer->end ()
« Reply #2 on: November 05, 2014, 07:18:08 AM »
I found out the problem - the error was very misleading...

It was to do with a mistake i had made where i was loading prefab ngui bits into static variables in a non-static Start() method