Title says it all, from a code perspective, how were Vector2 and Vector3 made interchangeable. Is it an implicit cast? An inheritance thing?
Simple code example of how they achieved it would be appreciated.
Implicit and explicit casting is made possible by defining conversion operators. Here is a pretty good description with an example for both: User-defined explicit and implicit conversion operators - provide conversions to different types | Microsoft Learn