Quantcast
Channel: Questions in topic: "fatal error"
Viewing all articles
Browse latest Browse all 182

Simple Code that crashes Unity for some strange reason!

$
0
0
The beggining of the code below is my constructor, the end is the function it calls. this.storage = InititalizeStorage(_colsAvailable, _rowsAvailable); } private InventorySlot[] InititalizeStorage(int cols, int rows)//, GUIStyle _style) { InventorySlot[] storageSlots = new InventorySlot[cols * rows]; for(int i = 0; i < storageSlots.Length; i++) storageSlots[i] = new InventorySlot(null);//, _style); return storageSlots; } When InitializedStorage is called from another function in start it works fine. So my only question is why does unity say "Fatal Error! Allocating memory when not allowed to"?

Viewing all articles
Browse latest Browse all 182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>