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 is an overload for all the Is methods, that is used like the following (only possible starting c#7 and upwards - it is a little less useful before)
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)
To be done by XDracam:
Add documentation of a use case to the markdown docu, and compile it.
You can use the example given in the xml docu of my Is method
I implemented an overload for Is, which enables the following: Instead of writing
there is an overload for all the
Is
methods, that is used like the following (only possible starting c#7 and upwards - it is 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)
To be done by XDracam: Add documentation of a use case to the markdown docu, and compile it. You can use the example given in the xml docu of my Is method