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

public class SlideDoor : Interactable
{
    bool IsOpen = false;
    public GameObject rightDoor;
    public GameObject leftDoor;

    void SlideRight()
    {
        if (!IsOpen)
        {
            Vector3 currentPosition = transform.position;
            currentPosition.z += 2;
            transform.position = currentPosition;
            IsOpen = true;
        }
        else
        {
            Vector3 currentPosition = transform.position;
            currentPosition.z -= 2;
            transform.position = currentPosition;
            IsOpen = false;
        }
    }

    public override void Interact()
    {
        SlideRight();
    }
}
