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

public abstract class Item : MonoBehaviour {

    public AudioClip hold;
    public AudioClip putDown;

    private bool held = false;
    private Transform heldLocation;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	public void Update () {
		if (held)
        {
            transform.position = heldLocation.position;
        }
	}

    public virtual void Hold(Transform location)
    {
        //print("HELD");
        held = true;
        heldLocation = location;
        SoundManager.instance.PlaySound(hold, true);
    }

    public abstract void Interact();

    public void LetGo()
    {
        SoundManager.instance.PlaySound(putDown, true);
        held = false;
    }
}
