unity gethashcode唯一吗 是唯一的值吗

Unity3D核心类型_精品文库_IThao123 - IT行业第一站
Unity3D核心类型一览
本文记录了Unity3D的最基本的核心类型。包括Object、GameObject、Component、Transform、Behaviour、Renderer、Collider、Rigidbody、Camera、Light、MonoBehaviour等。
需要展开了public类型方法的类图请点这里(/bitzhuwei/gallery/image/152116.html)。
最核心的类型就这几个:Object、GameObject、Component、Behaviour、MonoBehaviour。
需要展开了这几个public类型方法的类图请点这里(/bitzhuwei/gallery/image/152118.html)。
UnityEngine.Object
所有Unity3D的基类。
持有实例的ID信息。
实现了静态方法:增(Instantiate)删(Destroy)查(FindObjectsOfType)&
Any public variable you make that derives from Object gets shown in the inspector as a drop target, allowing you to set the value from the GUI.
namespace UnityEngine
& & using S
& & using pilerS
& & using System.Runtime.InteropS
& & using UnityEngine.I
& & using UnityEngineI
& & [StructLayout(LayoutKind.Sequential)]
& & public class Object
& & & & private ReferenceData m_UnityRuntimeReferenceD
& & & & private string m_UnityRuntimeErrorS
& & & & public override bool Equals(object o)
& & & & & & return CompareBaseObjects(this, o as UnityEngine.Object);
& & & & public override int GetHashCode()
& & & & & & return this.GetInstanceID();
& & & & private static bool CompareBaseObjects(UnityEngine.Object lhs, UnityEngine.Object rhs)
& & & & & & return CompareBaseObjectsInternal(lhs, rhs);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private static extern bool CompareBaseObjectsInternal([Writable] UnityEngine.Object lhs, [Writable] UnityEngine.Object rhs);
& & & & [NotRenamed]
& & & & public int GetInstanceID()
& & & & & & return this.m_UnityRuntimeReferenceData.instanceID;
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private static extern UnityEngine.Object Internal_CloneSingle(UnityEngine.Object data);
& & & & private static UnityEngine.Object Internal_InstantiateSingle(UnityEngine.Object data, Vector3 pos, Quaternion rot)
& & & & & & return INTERNAL_CALL_Internal_InstantiateSingle(data, ref pos, ref rot);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private static extern UnityEngine.Object INTERNAL_CALL_Internal_InstantiateSingle(UnityEngine.Object data, ref Vector3 pos, ref Quaternion rot);
& & & & [TypeInferenceRule(TypeInferenceRules.TypeOfFirstArgument)]
& & & & public static UnityEngine.Object Instantiate(UnityEngine.Object original, Vector3 position, Quaternion rotation)
& & & & & & CheckNullArgument(original, &The prefab you want to instantiate is null.&);
& & & & & & return Internal_InstantiateSingle(original, position, rotation);
& & & & [TypeInferenceRule(TypeInferenceRules.TypeOfFirstArgument)]
& & & & public static UnityEngine.Object Instantiate(UnityEngine.Object original)
& & & & & & CheckNullArgument(original, &The thing you want to instantiate is null.&);
& & & & & & return Internal_CloneSingle(original);
& & & & private static void CheckNullArgument(object arg, string message)
& & & & & & if (arg == null)
& & & & & & {
& & & & & & & & throw new ArgumentException(message);
& & & & & & }
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern void Destroy(UnityEngine.Object obj, [DefaultValue(&0.0F&)] float t);
& & & & [ExcludeFromDocs]
& & & & public static void Destroy(UnityEngine.Object obj)
& & & & & & float t = 0f;
& & & & & & Destroy(obj, t);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern void DestroyImmediate(UnityEngine.Object obj, [DefaultValue(&false&)] bool allowDestroyingAssets);
& & & & [ExcludeFromDocs]
& & & & public static void DestroyImmediate(UnityEngine.Object obj)
& & & & & & bool allowDestroyingAssets =
& & & & & & DestroyImmediate(obj, allowDestroyingAssets);
& & & & [MethodImpl(MethodImplOptions.InternalCall), TypeInferenceRule(TypeInferenceRules.ArrayOfTypeReferencedByFirstArgument), WrapperlessIcall]
& & & & public static extern UnityEngine.Object[] FindObjectsOfType(System.Type type);
& & & & public static T[] FindObjectsOfType&T&() where T: UnityEngine.Object
& & & & & & return Resources.ConvertObjects&T&(FindObjectsOfType(typeof(T)));
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public static UnityEngine.Object FindObjectOfType(System.Type type)
& & & & & & UnityEngine.Object[] objArray = FindObjectsOfType(type);
& & & & & & if (objArray.Length & 0)
& & & & & & {
& & & & & & & & return objArray[0];
& & & & & & }
& & & & & &
& & & & public static T FindObjectOfType&T&() where T: UnityEngine.Object
& & & & & & return (T) FindObjectOfType(typeof(T));
& & & & public string name { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern void DontDestroyOnLoad(UnityEngine.Object target);
& & & & public HideFlags hideFlags { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern void DestroyObject(UnityEngine.Object obj, [DefaultValue(&0.0F&)] float t);
& & & & [ExcludeFromDocs]
& & & & public static void DestroyObject(UnityEngine.Object obj)
& & & & & & float t = 0f;
& & & & & & DestroyObject(obj, t);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall, Obsolete(&use Object.FindObjectsOfType instead.&)]
& & & & public static extern UnityEngine.Object[] FindSceneObjectsOfType(System.Type type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), Obsolete(&use Resources.FindObjectsOfTypeAll instead.&), WrapperlessIcall]
& & & & public static extern UnityEngine.Object[] FindObjectsOfTypeIncludingAssets(System.Type type);
& & & & [Obsolete(&Please use Resources.FindObjectsOfTypeAll instead&)]
& & & & public static UnityEngine.Object[] FindObjectsOfTypeAll(System.Type type)
& & & & & & return Resources.FindObjectsOfTypeAll(type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public override extern string ToString();
& & & & public static implicit operator bool(UnityEngine.Object exists)
& & & & & & return !CompareBaseObjects(exists, null);
& & & & public static bool operator ==(UnityEngine.Object x, UnityEngine.Object y)
& & & & & & return CompareBaseObjects(x, y);
& & & & public static bool operator !=(UnityEngine.Object x, UnityEngine.Object y)
& & & & & & return !CompareBaseObjects(x, y);
UnityEngine.GameObject
/// &summary&
/// game object contains components.
/// &para&Add Component&/para&
/// &para&Find Component&/para&
/// &para&common components&/para&
/// &para&BroadcastMessage在这个游戏物体及其子物体的所有MonoBehaviour中调用名称为methodName的方法.&/para&
/// &/summary&
&GameObject.active&is obsolete. Use &GameObject.SetActive()&,
&&GameObject.activeSelf(read only) or
&GameObject.activeInHierarchy(read only)
&gameObject.SetActiveRecursively()&is obsolete.
Use &GameObject.SetActive(), which is
now inherited by children.
namespace UnityEngine
& & using S
& & using System.C
& & using System.Collections.G
& & using pilerS
& & using UnityEngine.I
& & using UnityEngineI
& & public sealed class GameObject : UnityEngine.Object
& & & & public GameObject()
& & & & & & Internal_CreateGameObject(this, null);
& & & & public GameObject(string name)
& & & & & & Internal_CreateGameObject(this, name);
& & & & public GameObject(string name, params System.Type[] components)
& & & & & & Internal_CreateGameObject(this, name);
& & & & & & foreach (System.Type type in components)
& & & & & & {
& & & & & & & & this.AddComponent(type);
& & & & & & }
& & & & public T AddComponent&T&() where T: Component
& & & & & & return (this.AddComponent(typeof(T)) as T);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern Component AddComponent(string className);
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public Component AddComponent(System.Type componentType)
& & & & & & return this.Internal_AddComponentWithType(componentType);
& & & & [ExcludeFromDocs]
& & & & public void BroadcastMessage(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object parameter =
& & & & & & this.BroadcastMessage(methodName, parameter, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void BroadcastMessage(string methodName, object parameter)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.BroadcastMessage(methodName, parameter, requireReceiver);
& & & & public void BroadcastMessage(string methodName, SendMessageOptions options)
& & & & & & this.BroadcastMessage(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void BroadcastMessage(string methodName, [DefaultValue(&null&)] object parameter, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern bool CompareTag(string tag);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern GameObject CreatePrimitive(PrimitiveType type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern GameObject Find(string name);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern GameObject[] FindGameObjectsWithTag(string tag);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public static extern GameObject FindGameObjectWithTag(string tag);
& & & & public static GameObject FindWithTag(string tag)
& & & & & & return FindGameObjectWithTag(tag);
& & & & public T GetComponent&T&() where T: Component
& & & & & & return (this.GetComponent(typeof(T)) as T);
& & & & public Component GetComponent(string type)
& & & & & & return this.GetComponentByName(type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument), WrapperlessIcall]
& & & & public extern Component GetComponent(System.Type type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern Component GetComponentByName(string type);
& & & & public T GetComponentInChildren&T&() where T: Component
& & & & & & return (this.GetComponentInChildren(typeof(T)) as T);
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public Component GetComponentInChildren(System.Type type)
& & & & & & if (this.activeInHierarchy)
& & & & & & {
& & & & & & & & Component component = this.GetComponent(type);
& & & & & & & & if (component != null)
& & & & & & & & {
& & & & & & & & & &
& & & & & & & & }
& & & & & & }
& & & & & & Transform transform = this.
& & & & & & if (transform != null)
& & & & & & {
& & & & & & & & IEnumerator enumerator = transform.GetEnumerator();
& & & & & & & & try
& & & & & & & & {
& & & & & & & & & & while (enumerator.MoveNext())
& & & & & & & & & & {
& & & & & & & & & & & & Transform current = (Transform) enumerator.C
& & & & & & & & & & & & Component componentInChildren = current.gameObject.GetComponentInChildren(type);
& & & & & & & & & & & & if (componentInChildren != null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & return componentInC
& & & & & & & & & & & & }
& & & & & & & & & & }
& & & & & & & & }
& & & & & & & & finally
& & & & & & & & {
& & & & & & & & & & IDisposable disposable = enumerator as ID
& & & & & & & & & & if (disposable == null)
& & & & & & & & & & {
& & & & & & & & & & }
& & & & & & & & & & disposable.Dispose();
& & & & & & & & }
& & & & & & }
& & & & & &
& & & & public T GetComponentInParent&T&() where T: Component
& & & & & & return (this.GetComponentInParent(typeof(T)) as T);
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public Component GetComponentInParent(System.Type type)
& & & & & & if (this.activeInHierarchy)
& & & & & & {
& & & & & & & & Component component = this.GetComponent(type);
& & & & & & & & if (component != null)
& & & & & & & & {
& & & & & & & & & &
& & & & & & & & }
& & & & & & }
& & & & & & Transform parent = this.transform.
& & & & & & if (parent != null)
& & & & & & {
& & & & & & & & while (parent != null)
& & & & & & & & {
& & & & & & & & & & if (parent.gameObject.activeInHierarchy)
& & & & & & & & & & {
& & & & & & & & & & & & Component component2 = parent.gameObject.GetComponent(type);
& & & & & & & & & & & & if (component2 != null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & return component2;
& & & & & & & & & & & & }
& & & & & & & & & & }
& & & & & & & & & & parent = parent.
& & & & & & & & }
& & & & & & }
& & & & & &
& & & & public T[] GetComponents&T&() where T: Component
& & & & & & return (T[]) this.GetComponentsInternal(typeof(T), true, false, true, false);
& & & & public void GetComponents&T&(List&T& results) where T: Component
& & & & & & this.GetComponentsForListInternal(typeof(T), typeof(T), false, true, false, results);
& & & & [CanConvertToFlash]
& & & & public Component[] GetComponents(System.Type type)
& & & & & & return this.GetComponentsInternal(type, false, false, true, false);
& & & & public void GetComponents(System.Type type, List&Component& results)
& & & & & & this.GetComponentsForListInternal(type, typeof(Component), false, true, false, results);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern void GetComponentsForListInternal(System.Type searchType, System.Type listElementType, bool recursive, bool includeInactive, bool reverse, object resultList);
& & & & public T[] GetComponentsInChildren&T&() where T: Component
& & & & & & return this.GetComponentsInChildren&T&(false);
& & & & public T[] GetComponentsInChildren&T&(bool includeInactive) where T: Component
& & & & & & return (T[]) this.GetComponentsInternal(typeof(T), true, true, includeInactive, false);
& & & & [ExcludeFromDocs]
& & & & public Component[] GetComponentsInChildren(System.Type type)
& & & & & & bool includeInactive =
& & & & & & return this.GetComponentsInChildren(type, includeInactive);
& & & & public void GetComponentsInChildren&T&(List&T& results) where T: Component
& & & & & & this.GetComponentsInChildren&T&(false, results);
& & & & public void GetComponentsInChildren&T&(bool includeInactive, List&T& results) where T: Component
& & & & & & this.GetComponentsForListInternal(typeof(T), typeof(T), true, includeInactive, false, results);
& & & & public Component[] GetComponentsInChildren(System.Type type, [DefaultValue(&false&)] bool includeInactive)
& & & & & & return this.GetComponentsInternal(type, false, true, includeInactive, false);
& & & & public T[] GetComponentsInParent&T&() where T: Component
& & & & & & return this.GetComponentsInParent&T&(false);
& & & & public T[] GetComponentsInParent&T&(bool includeInactive) where T: Component
& & & & & & return (T[]) this.GetComponentsInternal(typeof(T), true, true, includeInactive, true);
& & & & [ExcludeFromDocs]
& & & & public Component[] GetComponentsInParent(System.Type type)
& & & & & & bool includeInactive =
& & & & & & return this.GetComponentsInParent(type, includeInactive);
& & & & public void GetComponentsInParent&T&(bool includeInactive, List&T& results) where T: Component
& & & & & & this.GetComponentsForListInternal(typeof(T), typeof(T), true, includeInactive, true, results);
& & & & public Component[] GetComponentsInParent(System.Type type, [DefaultValue(&false&)] bool includeInactive)
& & & & & & return this.GetComponentsInternal(type, false, true, includeInactive, true);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern Component[] GetComponentsInternal(System.Type type, bool isGenericTypeArray, bool recursive, bool includeInactive, bool reverse);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern Component Internal_AddComponentWithType(System.Type componentType);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private static extern void Internal_CreateGameObject([Writable] GameObject mono, string name);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall, Obsolete(&gameObject.PlayAnimation is not supported anymore. Use animation.Play&)]
& & & & public extern void PlayAnimation(AnimationClip animation);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SampleAnimation(AnimationClip animation, float time);
& & & & [ExcludeFromDocs]
& & & & public void SendMessage(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object obj2 =
& & & & & & this.SendMessage(methodName, obj2, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void SendMessage(string methodName, object value)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.SendMessage(methodName, value, requireReceiver);
& & & & public void SendMessage(string methodName, SendMessageOptions options)
& & & & & & this.SendMessage(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SendMessage(string methodName, [DefaultValue(&null&)] object value, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [ExcludeFromDocs]
& & & & public void SendMessageUpwards(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object obj2 =
& & & & & & this.SendMessageUpwards(methodName, obj2, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void SendMessageUpwards(string methodName, object value)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.SendMessageUpwards(methodName, value, requireReceiver);
& & & & public void SendMessageUpwards(string methodName, SendMessageOptions options)
& & & & & & this.SendMessageUpwards(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SendMessageUpwards(string methodName, [DefaultValue(&null&)] object value, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SetActive(bool value);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall, Obsolete(&gameObject.SetActiveRecursively() is obsolete. Use GameObject.SetActive(), which is now inherited by children.&)]
& & & & public extern void SetActiveRecursively(bool state);
& & & & [MethodImpl(MethodImplOptions.InternalCall), Obsolete(&gameObject.StopAnimation is not supported anymore. Use animation.Stop&), WrapperlessIcall]
& & & & public extern void StopAnimation();
& & & & [Obsolete(&GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.&)]
& & & & public bool active { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public bool activeInHierarchy { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public bool activeSelf { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Animation animation { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public AudioSource audio { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Camera camera { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Collider collider { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Collider2D collider2D { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public ConstantForce constantForce { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public GameObject gameObject
& & & & & & get
& & & & & & {
& & & & & & & &
& & & & & & }
& & & & [Obsolete(&Please use guiTexture instead&)]
& & & & public GUIElement guiElement { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public GUIText guiText { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public GUITexture guiTexture { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public HingeJoint hingeJoint { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public bool isStatic { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & internal bool isStaticBatchable { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public int layer { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Light light { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public NetworkView networkView { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public ParticleEmitter particleEmitter { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public ParticleSystem particleSystem { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Renderer renderer { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Rigidbody rigidbody { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Rigidbody2D rigidbody2D { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public string tag { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Transform transform { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
所有的Component,都会指向其所属的GameObject。
在脚本中用&this.renderer&,&this.transform&,&this.GetComponent(XXX)&,&this.gameObject&与&this.gameObject.renderer&,&this.gameObject.transform&,&this.gameObject.GetComponent(XXX)&,&this.gameObject.gameObject&的结果是完全一样的。这意味着,你用&this.renderer.transform.renderer.collider&这种写法,仍然可以得到&this.collider&。(在这些组件不是&null&的前提下)
the &active&property is deprecated on components.
Please use &gameObject.active&instead.
If you meant to enable / disable a single component use &enabled&instead.
&GameObject.active&&is obsolete. Use &GameObject.SetActive(),
&GameObject.activeSelf(read only)&or &GameObject.activeInHierarchy(read
namespace UnityEngine
& & using S
& & using System.Collections.G
& & using pilerS
& & using UnityEngine.I
& & using UnityEngineI
& & public class Component : UnityEngine.Object
& & & & [ExcludeFromDocs]
& & & & public void BroadcastMessage(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object parameter =
& & & & & & this.BroadcastMessage(methodName, parameter, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void BroadcastMessage(string methodName, object parameter)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.BroadcastMessage(methodName, parameter, requireReceiver);
& & & & public void BroadcastMessage(string methodName, SendMessageOptions options)
& & & & & & this.BroadcastMessage(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void BroadcastMessage(string methodName, [DefaultValue(&null&)] object parameter, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern bool CompareTag(string tag);
& & & & public T GetComponent&T&() where T: Component
& & & & & & return (this.GetComponent(typeof(T)) as T);
& & & & public Component GetComponent(string type)
& & & & & & return this.gameObject.GetComponent(type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall, TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public extern Component GetComponent(System.Type type);
& & & & public T GetComponentInChildren&T&() where T: Component
& & & & & & return (T) this.GetComponentInChildren(typeof(T));
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public Component GetComponentInChildren(System.Type t)
& & & & & & return this.gameObject.GetComponentInChildren(t);
& & & & public T GetComponentInParent&T&() where T: Component
& & & & & & return (T) this.GetComponentInParent(typeof(T));
& & & & [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
& & & & public Component GetComponentInParent(System.Type t)
& & & & & & return this.gameObject.GetComponentInParent(t);
& & & & public T[] GetComponents&T&() where T: Component
& & & & & & return (T[]) this.GetComponentsWithCorrectReturnType(typeof(T));
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern Component[] GetComponents(System.Type type);
& & & & public void GetComponents&T&(List&T& results) where T: Component
& & & & & & this.GetComponentsForListInternal(typeof(T), typeof(T), false, true, results);
& & & & public void GetComponents(System.Type type, List&Component& results)
& & & & & & this.GetComponentsForListInternal(type, typeof(Component), false, true, results);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern void GetComponentsForListInternal(System.Type searchType, System.Type listElementType, bool recursive, bool includeInactive, object resultList);
& & & & public T[] GetComponentsInChildren&T&() where T: Component
& & & & & & return this.GetComponentsInChildren&T&(false);
& & & & public T[] GetComponentsInChildren&T&(bool includeInactive) where T: Component
& & & & & & return this.gameObject.GetComponentsInChildren&T&(includeInactive);
& & & & public void GetComponentsInChildren&T&(List&T& results) where T: Component
& & & & & & this.GetComponentsInChildren&T&(false, results);
& & & & [ExcludeFromDocs]
& & & & public Component[] GetComponentsInChildren(System.Type t)
& & & & & & bool includeInactive =
& & & & & & return this.GetComponentsInChildren(t, includeInactive);
& & & & public void GetComponentsInChildren&T&(bool includeInactive, List&T& result) where T: Component
& & & & & & this.gameObject.GetComponentsInChildren&T&(includeInactive, result);
& & & & public Component[] GetComponentsInChildren(System.Type t, [DefaultValue(&false&)] bool includeInactive)
& & & & & & return this.gameObject.GetComponentsInChildren(t, includeInactive);
& & & & public T[] GetComponentsInParent&T&() where T: Component
& & & & & & return this.GetComponentsInParent&T&(false);
& & & & public T[] GetComponentsInParent&T&(bool includeInactive) where T: Component
& & & & & & return this.gameObject.GetComponentsInParent&T&(includeInactive);
& & & & [ExcludeFromDocs]
& & & & public Component[] GetComponentsInParent(System.Type t)
& & & & & & bool includeInactive =
& & & & & & return this.GetComponentsInParent(t, includeInactive);
& & & & public Component[] GetComponentsInParent(System.Type t, [DefaultValue(&false&)] bool includeInactive)
& & & & & & return this.gameObject.GetComponentsInParent(t, includeInactive);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & private extern Component[] GetComponentsWithCorrectReturnType(System.Type type);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & internal extern GameObject InternalGetGameObject();
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & internal extern Transform InternalGetTransform();
& & & & [ExcludeFromDocs]
& & & & public void SendMessage(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object obj2 =
& & & & & & this.SendMessage(methodName, obj2, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void SendMessage(string methodName, object value)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.SendMessage(methodName, value, requireReceiver);
& & & & public void SendMessage(string methodName, SendMessageOptions options)
& & & & & & this.SendMessage(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SendMessage(string methodName, [DefaultValue(&null&)] object value, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [ExcludeFromDocs]
& & & & public void SendMessageUpwards(string methodName)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & object obj2 =
& & & & & & this.SendMessageUpwards(methodName, obj2, requireReceiver);
& & & & [ExcludeFromDocs]
& & & & public void SendMessageUpwards(string methodName, object value)
& & & & & & SendMessageOptions requireReceiver = SendMessageOptions.RequireR
& & & & & & this.SendMessageUpwards(methodName, value, requireReceiver);
& & & & public void SendMessageUpwards(string methodName, SendMessageOptions options)
& & & & & & this.SendMessageUpwards(methodName, null, options);
& & & & [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
& & & & public extern void SendMessageUpwards(string methodName, [DefaultValue(&null&)] object value, [DefaultValue(&SendMessageOptions.RequireReceiver&)] SendMessageOptions options);
& & & & [Obsolete(&the active property is deprecated on components. Please use gameObject.active instead. If you meant to enable / disable a single component use enabled instead.&)]
& & & & public bool active { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Animation animation { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public AudioSource audio { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }
& & & & public Camera camera { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] }

我要回帖

更多关于 hashcode是否唯一 的文章

 

随机推荐