2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
7 [StructLayout(LayoutKind.Sequential)]
10 private IntPtr this_ptr = (IntPtr)0;
17 [MethodImpl(MethodImplOptions.InternalCall)]
23 public string name { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
28 public string uniqueName { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
33 public bool enabled { [MethodImpl(MethodImplOptions.InternalCall)]
get; [MethodImpl(MethodImplOptions.InternalCall)]
set; }
38 public bool active { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
43 public string tag { [MethodImpl(MethodImplOptions.InternalCall)]
get; [MethodImpl(MethodImplOptions.InternalCall)]
set; }
48 public int layer { [MethodImpl(MethodImplOptions.InternalCall)]
get; [MethodImpl(MethodImplOptions.InternalCall)]
set; }
87 return INTERNAL_get_component_t<T>(typeof(
T));
97 return INTERNAL_add_component_t<T>(typeof(
T));
104 [MethodImpl(MethodImplOptions.InternalCall)]
114 return INTERNAL_find(
name);
124 return INTERNAL_getByUniqueName(
name);
129 [MethodImpl(MethodImplOptions.InternalCall)]
132 [MethodImpl(MethodImplOptions.InternalCall)]
133 private static extern GameObject INTERNAL_getByUniqueName(
string name);
135 [MethodImpl(MethodImplOptions.InternalCall)]
136 private extern T INTERNAL_get_component_t<T>(Type type);
138 [MethodImpl(MethodImplOptions.InternalCall)]
139 private extern T INTERNAL_add_component_t<T>(Type type);
T AddComponent< T >()
Create new component of type T and attach it to this game object
Component[] components
Return an array of all game object's components
Animation animation
Animation component
bool enabled
Get or set game object enabled state
string uniqueName
Return game object unique name (UID)
GameObject()
Create new empty game object
AudioSource audioSource
AudioSource component
static GameObject GetByUniqueName(string name)
Return game object by it's unique name (UID)
Rigidbody rigidbody
RigidBody component
GameObject Clone()
Create a copy of this game object
Transform transform
Transform component
static GameObject Find(string name)
Find game object by name. If scene has multiple game objects with the same name, the first will be re...
int layer
Get or set game object layer
string tag
Get or set game object tag
bool active
Return true if game object enabled self and all of it's parents are enabled too
string name
Return game object name
NavMeshAgent navMeshAgent
NavMeshAgent component
T GetComponent< T >()
Return component by type