public static T MissingComponent <T>([NotNull] this GameObject gameObject) where T : Component { if (gameObject is null) { throw new NullReferenceException(nameof(gameObject)); } if (!gameObject) { throw new MissingReferenceException(nameof(gameObject)); } return(GameObjectUtilities.MissingComponentWithoutChecks <T>(gameObject)); }
public static Component MissingComponent([NotNull] this GameObject gameObject, Type componentType) { if (gameObject is null) { throw new NullReferenceException(nameof(gameObject)); } if (!gameObject) { throw new MissingReferenceException(nameof(gameObject)); } return(GameObjectUtilities.MissingComponentWithoutChecks(gameObject, componentType)); }