Skip to content

Instantly share code, notes, and snippets.

@strich
Created March 12, 2015 23:44
Show Gist options
  • Save strich/a4d49e0700e3088692b1 to your computer and use it in GitHub Desktop.
Save strich/a4d49e0700e3088692b1 to your computer and use it in GitHub Desktop.
public static class GameObjectExtensions {
public static bool HasComponent<T>(this GameObject gameObject) {
return gameObject.GetComponent<T>() != null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment