简体   繁体   中英

subtract one list from another in unity c#

How can I subtract List "firstList" from List "secondList" in unity c#. I have found answers to do this with LINQ and HashSet but after reading this and this I am very doubtful to use those. Please point me in right direction because I have to deploy my game on IOS and Android both.

"The posts you link to are talking about C#2.0, which does not support LINQ"

That... may not be entirely relevant, as C# version and .NET version is not necessarily a 1:1 match.

That said, Unity (actually Mono) definitely supports LINQ.

Still, LINQ basically just generates code and delegates it hides, while the actual implementation (IL) is still most likely simply loops (over loops). So syntactic sugar aside, the question rather is is which of the sets are larger (if you care about efficiency) and probably use that as the outer loop.

++luck;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM