|
Hi! Here's how my code works: and : Now, the problem is that I need to return the array from myClass to myMainClass "on-the-fly", that is, even if the array is not completely filed, it already has to return its first values. Thank you! Note: I use a list at first (and eventually convert it to an array) because of its dynamic size property.
(comments are locked)
|
|
Well It seems you just want a reference to the array in your main class. Just have the array as a public class level variable in your sub class and call the ref. But beware if the array is not instantiated it will throw an exception. Or another function or getter.
(comments are locked)
|

I don't know what your purposes are. It sounds like you're trying to do something asynchronously. Maybe you can explain a bit more what you are trying to achieve? Consider using enumerables or queues depending on your needs.
I agree with statement... and: You should probably be doing the filling on a different function and the extracting of the array only when needed. OnGUI is called several times in one frame and you do not need updates so often.