当前位置:网站首页>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.
边栏推荐
- ALC实验
- 错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
- VLAN介绍与实验
- DevOps process demo (practical record)
- Spark source code - task submission process - 6-sparkContext initialization
- From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
- Tencent Cloud Message Queue CMQ
- I/O performance and reliability
- LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
- The size of the screen adaptation
猜你喜欢
随机推荐
Mina的长连接和短连接
IP packet format (ICMP protocol and ARP protocol)
NAT experiment
Tencent Cloud Message Queue CMQ
Wireshark packet capture and common filtering methods
Complete mysql offline installation in 5 minutes
带你深入了解Cookie
教您简单几步实现工业树莓派正确安装RS232转USB驱动
The size of the screen adaptation
network issue?Service packet loss?This is enough
Mina disconnects and reconnects
King power volume LinkSLA, realize operations engineer is happy fishing
Browser Storage WebStorage
wc、grep、tar、vi/vim
Problems encountered in installing Yolo3 target detection module in Autoware
磁盘管理与文件系统
link 和@improt的区别
Quick question and quick answer - FAQ of Tencent Cloud Server
LeetCode练习及自己理解记录(1)
传输层协议