﻿using UnityEngine;
using System.Collections;

public class Wreath : MonoBehaviour {

	private GameObject victim;
	private Animator animator;

	// Use this for initialization
	void Start () {
		animator = GetComponent<Animator> ();
	}

	void OnTriggerEnter2D (Collider2D collider) {
		victim = collider.gameObject;
		//If not an attacker, then don't go off.
		if (!victim.GetComponent<Attacker> ()) {
			return;
		} else {
			animator.SetTrigger("ImMelting");
		}				
	}

	void MeltGoon(){
		Destroy (victim);

	}

	void DestroyWreath (){
		Destroy (gameObject);
	}
}
