Hi all,
I’m refactoring some existing C# code and all of the sudden I get:
“Fatal error in gc
Too many heap sections”
Unity crashes to desktop…
I have no idea were to begin to track this down, any ideas?
All I did in the refactoring is created a public Vector2 variable that gets initialized in the Start function.
Then I used it to replaced some redundant code in that class which was basically doing a basic arithmetic calculation.
In fact I can reproduce the crash by editing a single line:
This works:
float nCost = node.IsDiagnal(current) ? 7 : 5;
This crashes if I replace the numbers with the aforementioned Vector2 variable:
float nCost = node.IsDiagnal(current) ? myVec2.x : myVec2.y;
Thoughts?
Thanks!