using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Loot : MonoBehaviour {
    public enum Type { None, Sword, Shield, Coin }
    [SerializeField]
    private Type _type;
    public Type type { get { return _type; } }

    private bool blasted = false;
    private float blastedTimer = 0;
    private float timerThreshold = 50;

    private void OnTriggerEnter(Collider other)
    {
        if (other == Player.instance.GetComponent<CapsuleCollider>())
        {
            switch (_type)
            {
                case Type.Sword:
                    Player.instance.hasSword = true;
                    break;
                case Type.Shield:
                    Player.instance.hasShield = true;
                    break;
                case Type.Coin:
                    Player.instance.coins++;
                    break;
            }
            Destroy(gameObject);
        }
    }
}
