XDracam / unity-corelibrary

Collection of classes and extension methods that make life with Unity3D more comfortable
MIT License
15 stars 3 forks source link

Added Object.SafeDestroy extension method. Added IEnumerable<T>.TakeW… #2

Closed Eregerog closed 5 years ago

Eregerog commented 5 years ago

Please take a look at the code and if you like it, incorporate it :) You will have to add it to the documentation, though

XDracam commented 5 years ago

Both ideas are nice. I can see why SafeDestroy would be useful, but only after consulting the unity documentation. More intuitive comments would be useful.

For the TakeWhile inclusive part - you are right, there is no way to represent this in another way. But naming is a difficulty. Maybe TakeWhileInclusive ? I'm not sure.

XDracam commented 5 years ago

SafeDestroy is now implemented The LINQ-part is too specific right now and I don't want to clutter the core library. This should not be another C++ boost. Might reconsider in the future when we have more useful LINQ extensions.