using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class PlayerHealth : MonoBehaviour {

    
	void Start () 
    {
        NotificationCenter.DefaultCenter().AddObserver(this,"PlayerIsDead");
	}

    void PlayerIsDead(Notification notificacion)
    {
        this.gameObject.SetActive(false);
     
        
       
    }

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Grounded"))
        {
            this.gameObject.transform.parent = other.transform;
            Debug.Log("Parent");
        }
    }

    void OnTriggerExit2D(Collider2D other)
    {
        if (other.CompareTag("Grounded"))
        {
            this.gameObject.transform.parent=null;
            Debug.Log("No Parent");
        }
    }
	
	
	
}
