Version: 5.3

CapsuleCollider

class in UnityEngine

/

다음으로부터 상속:Collider

매뉴얼로 전환

설명

A capsule-shaped primitive collider.

Capsules are cylinders with a half-sphere at each end.

See Also: BoxCollider, SphereCollider, PhysicMaterial, Rigidbody.

변수

centerThe center of the capsule, measured in the object's local space.
directionThe direction of the capsule.
heightThe height of the capsule meased in the object's local space.
radiusThe radius of the sphere, measured in the object's local space.

상속된 멤버

변수

attachedRigidbodyThe rigidbody the collider is attached to.
boundsThe world space bounding volume of the collider.
contactOffsetContact offset value of this collider.
enabledEnabled Colliders will collide with other colliders, disabled Colliders won't.
isTriggerIs the collider a trigger?
materialThe material used by the collider.
sharedMaterialThe shared physic material of this collider.
gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public 함수

ClosestPointOnBoundsThe closest point to the bounding box of the attached collider.
RaycastCasts a Ray that ignores all Colliders except this one.
BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagIs this game object tagged with tag ?
GetComponentReturns the component of Type type if the game object has one attached, null if it doesn't.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

정적 함수

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateReturns a copy of the object original.

연산자

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

메시지

OnCollisionEnterOnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
OnCollisionExitOnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
OnCollisionStayOnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
OnTriggerEnterOnTriggerEnter is called when the Collider other enters the trigger.
OnTriggerExitOnTriggerExit is called when the Collider other has stopped touching the trigger.
OnTriggerStayOnTriggerStay is called almost all the frames for every Collider other that is touching the trigger.