Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

ohhh, that is very astute, I would have never thought of doing that. Although, I am wondering which C# collection you are using that is worth having all this extra boilerplate code?

I'm self-taught, only ever learnt C# (and a little C/CPP), work alone, and only been programming for 5-6y - so I will often do things in bad, wrong, or stupid ways, depending on what seems to work. Take anything I say with a hefty slab of salt.

My current thingamajig is a node that manages a fairly big queue - not using a Queue collection as a fundament seemed silly, and Queue/Dequeue operations on large collections are very fast compared to the equivalent ops on an array. I don't need serialisation, so all I do is initialise the collection as null, assign it during '_Ready', and I can depend on it being available for the remainder of operations without throwing any untraceable errors. 

It's not *too* onerous in terms of boilerplate if you *do* want serialisation; something like what's below does the majority of the heavy lifting, you've just got to assign cached_Vecs using queue.ToArray() at some point.

[Export] Vector3[] serialised { get{ queue ??= new(cached); return cached; } set{} }
[Export] Vector3[] cached = Array.Empty<Vector3>();
Queue<Vector3> queue = null;