当前位置:网站首页>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 experiment
Transport layer protocol (TCP 3-way handshake)
Vim tutorial: vimtutor
DevOps process demo (practical record)
网络不通?服务丢包?看这篇就够了
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
Wireshark packet capture and common filtering methods
传输层协议
干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站
LeetCode中常用语言的一些基本方法记录
随机推荐
The method of using ROS1 bag under ROS2
LinkSLA坚持用户第一,打造可持续的运维服务方案
[问题已处理]-jenkins流水线checkout超时
Switch principle
This is indeed the best article on microservice architecture I have read!
wc, grep, tar, vi/vim
Network Troubleshooting Basics - Study Notes
LeetCode Interview Questions
One-arm routing experiment and three-layer switch experiment
Small example of regular expression--validate email address
network issue?Service packet loss?This is enough
从“双卡双待“到”双通“,vivo率先推动DSDA架构落地
请问下通过flink sql读取hologres 的两张表的 binlog,然后如何进行join?
disabledDate 日期选择器 datePicker
系统基础-学习笔记(一些命令记录)
Growth: IT Operations Trends Report
LeetCode练习及自己理解记录(1)
Tencent greetings function SCF - entry instructions
Transport layer protocol (TCP 3-way handshake)
Dry!Teach you to use industrial raspberries pie combining CODESYS configuration EtherCAT master station