お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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.
Closeゲームオブジェクトのジョイントが壊れた時に呼び出されます
ジョイントのbreakForceより大きい力が与えられた時に、ジョイントは壊れます。 ジョイントが壊れた時、OnJointBreakが呼び出されジョイント部分に力が適用されます。 OnJointBreakのあと、ジョイントは自動的にゲームオブジェクトから削除されます。 See Also: Joint.breakForce.
function OnJointBreak(breakForce : float) { Debug.Log("Joint Broke!, force: " + breakForce); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnJointBreak(float breakForce) { Debug.Log("Joint Broke!, force: " + breakForce); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def OnJointBreak(breakForce as float) as void: Debug.Log(('Joint Broke!, force: ' + breakForce))