using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets._2D;

public class KillTube : MonoBehaviour {

	public GameObject keyprompt;
	public GameObject FirstScientist;
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
		if (this.transform.tag == "UnPossessed") {

			this.transform.tag = "Untagged";
			Destroy(keyprompt);
			Destroy(this.GetComponent<SwitchTrigger>());
			Destroy(this.GetComponent<Collider2D>());
			Destroy(this.GetComponent<Platformer2DUserControl>());
			Destroy(this.GetComponent<PlatformerCharacter2D>());
			Destroy(this.GetComponent<Rigidbody2D>());
			FirstScientist.GetComponent<SwitchTrigger>().HumansInRange.Clear();
			FirstScientist.GetComponent<SwitchTrigger>().Selected = null;
			Destroy(this);


		}
	}
}
