We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#if UNITY_EDITOR // v1 No.6 [MethodAPI] [APIDescriptionCN("遍历 List (可获得索引)")] [APIDescriptionEN("foreach List (can get index)")] [APIExampleCode(@" var testList = new List<string> {""a"", ""b"", ""c"" }; testList.Foreach((c,index)=>Debug.Log(index)); // 1, 2, 3, ")] #endif public static void ForEach<T>(this List<T> list, Action<int, T> action) { for (var i = 0; i < list.Count; i++) { action(i, list[i]); } }
方法传参的action中index在前,而注释里的index在后。注释和API需要改变其中一个,否则ForEach<int>的调用会产生混淆 ps:对于js/ts index在后是正确的,而考虑兼容性就不方便改变已有API,但二者必改其一
ForEach<int>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
方法传参的action中index在前,而注释里的index在后。注释和API需要改变其中一个,否则
ForEach<int>
的调用会产生混淆ps:对于js/ts index在后是正确的,而考虑兼容性就不方便改变已有API,但二者必改其一
The text was updated successfully, but these errors were encountered: