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