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