format
typescript
Queue.get(index)class: Queue
description
Get the value of an element based on its index (index starts from 0).
parameter
| param_name | type | description |
|---|---|---|
| index | number | The index of the element. |
reture
| type | description |
|---|---|
T|undefined |
code example
typescript
let queue = new Queue<Number>();
for (let index = 0; index < 3; index++) {
queue.Enqueue(index);
}
let value = queue.get(0);
Debug.Log("The value of element at index 0 is: ", value);