Version: 5.3 (switch to 5.4b)
언어English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

MonoBehaviour.OnJointBreak2D(Joint2D)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

닫기

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

닫기

취소

Switch to Manual

Description

같은 게임오브젝트로 어태치된 조인트가 파괴되었을 때 호출됩니다.

When the Joint2D.reactionForce is higher than the Joint2D.breakForce or the Joint2D.reactionTorque is higher than the Joint2D.breakTorque of the joint, the joint will break. 조인트를 분리하면 OnJointBreak가 호출되어 조인트에 적용된 브레이크 힘이 전달됩니다. OnJointBreak 후, 게임 오브젝트로부터 자동적으로 분리된 후 파기됩니다.

See Also: Joint2D.breakForce, Joint2D.breakTorque, Joint2D.reactionForce and Joint2D.reactionTorque.


        
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnJointBreak2D (Joint2D brokenJoint) { Debug.Log ("A joint has just been broken!"); Debug.Log ("The broken joint exerted a reaction force of " + brokenJoint.reactionForce); Debug.Log ("The broken joint exerted a reaction torque of " + brokenJoint.reactionTorque); } }