13using System.Runtime.CompilerServices;
14using System.Runtime.InteropServices;
30 public string name { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
35 public string uniqueName { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
74 return INTERNAL_get_component_t<T>(typeof(
T));
84 return INTERNAL_find_object_of_type_t<T>(typeof(
T), findInactive);
94 return INTERNAL_find_objects_of_type_t<T>(typeof(
T), findInactive);
112 INTERNAL_destroy_component(component);
118 [MethodImpl(MethodImplOptions.InternalCall)]
119 private extern T INTERNAL_get_component_t<T>(Type type);
121 [MethodImpl(MethodImplOptions.InternalCall)]
122 private static extern T INTERNAL_find_object_of_type_t<T>(Type type,
bool findInactive);
124 [MethodImpl(MethodImplOptions.InternalCall)]
125 private static extern T[] INTERNAL_find_objects_of_type_t<T>(Type type,
bool findInactive);
127 [MethodImpl(MethodImplOptions.InternalCall)]
130 [MethodImpl(MethodImplOptions.InternalCall)]
131 private extern void INTERNAL_destroy_component(
Component component);
GameObject gameObject
Get game object at which this component is attached
NavMeshAgent navMeshAgent
NavMeshAgent component
AudioSource audioSource
AudioSource component
Transform transform
Transform component
static T FindObjectOfType< T >(bool findInactive=true)
Find object of type
static T[] FindObjectsOfType< T >(bool findInactive=true)
Find objects of type
Component[] components
Return an array of all game object's components
void Destroy(GameObject gameObject)
Destroy game object
string name
Game object's name
void Destroy(Component component)
Destroy component
Animation animation
Animation component
Rigidbody rigidbody
Rigidbody component
string uniqueName
Game object's unique name (UID)
T GetComponent< T >()
Return component by type