hello, i am making a model that has an input string which will have a value similar to “1,2,3,4,5,6,7,!” but each number will be added in one by one with the comma.
i would also like these numbers as they are entered into this value called ‘Destination’ to be inserted into an array to act like a buffer.
while it is doing this a co routine will read the first value in the buffer (Destination needed to be split with the comma being the delimeter) rotate an object acordingly run a custom function and then remove the first value from the array. this will repeat untill the buffer array is empty or untill the character “!” i the first value in the buffer.
how would i go about:
making an empty array called buffer, adding values into the end of the buffer, reading the first value in the buffer and then removing it bumping the other values up in the array?
and when ever it is called this is what comes up in the consol:
InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Generic.Queue`1[System.String].Peek ()
System.Collections.Generic.Queue`1[System.String].Dequeue ()
stargate.dialGate (Int32 mode) (at Assets/stargate.cs:179)
stargate.DestinationChanged () (at Assets/stargate.cs:211)
what is causing this? (apart from that the queue idea is going well:)
InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Generic.Queue`1[System.String].Peek ()
System.Collections.Generic.Queue`1[System.String].Dequeue ()
stargate.dialGate (Int32 mode) (at Assets/stargate.cs:175)
stargate.DestinationChanged () (at Assets/stargate.cs:208)
I am facing a similar problem, at the moment. The code seems to be working properly, but I can’t seem to stop this error. With some Debug.Log commands I’ve determined that the Queue is both non-null and non-empty, but the error continues nontheless.