Quantcast
Viewing latest article 4
Browse Latest Browse All 8

Answer by maxnorth

I figured out the problem, and it has to do with the way that the serializer works with default constructors. I was able to make the array have the correct length in two ways: 1) by marking each field with a NonSerializableAttribute (which was not ideal because at the very least I want users to be able to modify the class from the Inspector), and 2) by not having a default constructor with the AddToStaticArray() method. Even when I wasn't using the default constructor to initialize my fields, the serializer was calling it multiple times, apparently. So, since I wanted to keep serialization, I decided to forego the default constructor.

Viewing latest article 4
Browse Latest Browse All 8

Trending Articles



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