Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样设置的Texture2D数组;
map = new Texture2D[30, 18];
但是,当我尝试引用 map[30, 1] 时,我得到一个超出数组范围的索引错误。为什么会发生这种情况?
谢谢。
C# 数组从 0 开始索引,因此长度为 30 的数组的有效索引是 0 到 29。