I've encountered a strange problem. In my game I have a prefab called UiManager. It has two public Text-fields, one for score, and one for lives. I only have one instance of this prefab and I've assigned the two Text-fields with two text-objects. Yesterday it worked well.
Today I reopened my project and started the game and when I collected a life I got a null reference on the text field Lives. Now clearly it is not null, I tried to delete my instance and recreate it and then assigning the Text-fields again, and it worked.
I then saved my project and exited Unity and reopened my project and now the issue was back again, a null reference on Lives. Also I noticed that it is not possible to apply ui-objects to a prefab (?).
Anyway, does anyone have any idea why this occurs?
Have a nice day!