using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HingeJointBreakReceiver : MonoBehaviour
{
    void OnJointBreak(float breakForce)
    {
        Debug.Log("Hinge Joint broken! Break force: " + breakForce);

        // Perform actions when the hinge joint breaks
        HandleJointBreak();
    }

    private void HandleJointBreak()
    {
        // Example action: Spawn debris or play an explosion effect
        Debug.Log("Handling joint break...");
        UIManager.instance.GameOver();
        // Add your specific logic here, e.g., play sound, destroy object, etc.
    }
}
