public static bool HasComponent <T>(this Component component) where T : Component { return(component.GetComponent <T>() != null); }
public static T GetOrAddComponent <T>(this Component component) where T : Component { return(component.GetComponent <T>() ?? component.AddComponent <T>()); }