当前位置:网站首页>GetEnumerator method and MoveNext and Reset methods in Unity
GetEnumerator method and MoveNext and Reset methods in Unity
2022-08-05 06:33:00 【IT apprentice.】
GetEnumerator method and MoveNext and Reset methods in Unity
Function: is a method in the System.Collections namespace that returns an enumerator that iterates through the collection.
Return value: Returns an actionable enumerator.
Note: can be used to read data in a collection, but not to modify the underlying collection.
As shown here, we define a dictionary to store the data of type ClientWorldNodeData and its index:
Then call it here:
You can get all the enumeration data in this collection (can only be read but not modified), and the enumerator will be positioned before the first element in the collection at the beginning.Then use the IEnumerator.Current property (similar to pointers in C++) to get the element in the collection at the current position of the enumerator.
MoveNext
Action: MoveNext sets Current to the next element.(similar to moving a pointer back one place in C++)
Note: If MoveNext goes past the end of the set, the enumerator will be placed last in the setAfter an element, and MoveNext returns false.
Reset
Effect: Sets the enumerator to its initial position, which is before the first element in the collection.
边栏推荐
猜你喜欢
随机推荐
selenium learning
LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
VRRP概述及实验
The size of the screen adaptation
VRRP overview and experiment
What are some things that you only know when you do operation and maintenance?
传输层协议
Native JS takes you to understand the implementation and use of array methods
Transformer详细解读与预测实例记录
NAT experiment
Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
link 和@improt的区别
Wireshark packet capture and common filtering methods
The highlight moment of operation and maintenance starts with intelligence
What?CDN cache acceleration only works for accelerating static content?
Seven Ways to Center a Box Horizontally and Vertically
Disk management and file systems
The idea of commonly used shortcut key
CIPU, what impact does it have on the cloud computing industry?









