This has happened to me so many times and I am at a loss to explain why.
If I say
Everything compiles fine but at runtime I get unallocated object errors and it simply doesn’t work…
Then I do this:
panels = new _PanelInfo[3];
for (x= 0; x < panels.length; x++)
panels[x] = new _PanelInfo();
panels[1].side = eScreenSide.Right;
and now everything works just fine…
So I go an edit some other files and I compile the other files and I run the game a couple of times and then suddenly I get a compile time error saying :
Void? When does _PanelCode become a Void?
Why does it work one moment and then not the next? Even by restarting Unity it still recognizes this as an error… Why? How do I overcome this?
The problem is that your _PanelInfo function does not return _PanelInfo but returns void by its function declaration.
That is at least what the error indicates.
This might potentially be related to the missing new there as you call the constructor without new, at least if you are using C#