﻿using UnityEngine;
using System.Collections;

namespace Nostalgia.Example
{
	[AddComponentMenu("Nostalgia/Example/Goal")]
	public sealed class Goal : MonoBehaviour
	{
		void OnTriggerEnter2D(Collider2D other)
		{
			Player player = other.GetComponent<Player>();
			if (player != null)
			{
				player.Goal();

				Destroy(this);
			}
		}
	}
}
