I've seen a shorthand of "if a component was found in the IF condition, use it"
so instead of this
SomeScript script = gameObject.GetComponent<SomeScript>();
if (script != null) {
script.DoSomething();
}
I saw some kind of shorthand like this
if (SomeScript script = gameObject.GetComponent<SomeScript>()) {
script.DoSomething();
}
Anyone know what I mean? Sorry for not knowing the terminology