using UnityEngine;
using System.Collections;

public class SpringBreak : MonoBehaviour {

	ConfigurableJoint joint;
	GameObject Warnings;

	void Awake() {
		transform.parent = null;
		// instantly ditch the parent because rigidbodies fuck up when parented
	}

	// Use this for initialization
	void Start () {
		Warnings = GameObject.Find("Warnings");
		joint = (ConfigurableJoint)gameObject.GetComponent<ConfigurableJoint>();
	}
	
	// Update is called once per frame
	void Update () {

	}

	void OnJointBreak(float breakForce) {
		Warnings.guiText.text =  "Docking ring destroyed" ;
		Magnetism MagScript = GetComponent<Magnetism>();
		MagScript.enabled = false;
	}
}
