Closed Eregerog closed 5 years ago
I implemented an overload for Is, which enables the following: Instead of writing
if(this.Is<Collider>(Search.InChildren)){ var collider = this.As<Collider>(Search.InChildren); collider.trigger = true; }
there could be an overload for all the Is methods, that is used like the following (in c#7 and updwards, a little less useful before)
Is
if(this.Is<Collider>(out var result, Search.InChildren)){ result.trigger = true; }
Saves a line and an unneccesarry query, without really sacrificing readability. It kinda works like if(foo is MyClass asMyClass)
if(foo is MyClass asMyClass)
See #27
I implemented an overload for Is, which enables the following: Instead of writing
there could be an overload for all the
Is
methods, that is used like the following (in c#7 and updwards, a little less useful before)Saves a line and an unneccesarry query, without really sacrificing readability. It kinda works like
if(foo is MyClass asMyClass)