using UnityEngine;
using System.Collections;
public class PlayerKiller : MonoBehaviour
{
private CoinCounter coinCounter
{
get
{
return GetComponent();
}
}
public GameObject enemykiller;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
//FIX THIS
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("Enemy"))
{
if (coinCounter.count >= 2)
{
Destroy(enemykiller);
coinCounter.count = coinCounter.count - 2;
}
if (coinCounter.count < 2)
{
Application.LoadLevel(Application.loadedLevel);
}
}
}
}//end script