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

public class EnableElevatorsScript : MonoBehaviour
{

    public Sprite pressed;
    public GameObject[] elevators;

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.GetComponent<PlayerScript2>())
        {
            GetComponent<SpriteRenderer>().sprite = pressed;
            foreach(GameObject g in elevators)
            {
                g.GetComponent<ElevatorScript>().enab = true;
            }
        }
    }
}
