using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Assets.Scripts.Interface;

public class GrabableObject : InteractiveObject
{


    protected bool toggle = false;
    protected bool grabbed = false;

    public override string InteractType
    {
        get
        {
            return "grab";
        }
    }

    public override void OnInteract()
    {
        return;
    }

    protected override void FixedUpdate()
    {
        if ((levelManager.player.transform.position - transform.position).magnitude < 1f)
        {
            toggle = true;
        }
        else
        {
            toggle = false;
        }

        if (toggle && Input.GetKeyDown("g"))
        {
            grabbed = !grabbed;
        }

        if (grabbed)
        {
            v = levelManager.player.v;
            Debug.Log("being grabbed");
        }

        base.FixedUpdate();
    }
}
