using UnityEngine;
using System.Collections;

public class Wall : MonoBehaviour {

    private bool isTransparent = false;
    private int transparentCounter = 0;

    void Update()
    {
        transparentCounter++;
        if (isTransparent && transparentCounter > 3)
        {
            Color normalColor = new Color(1, 1, 1, 1);
            gameObject.renderer.material.color = normalColor;
            isTransparent = false;
        }
    }

    void MakeTransparent()
    {
        transparentCounter = 0;
        if (!isTransparent)
        {
            Color transColor = new Color(1, 1, 1, 0.6f);
            gameObject.renderer.material.color = transColor;
            isTransparent = true;
        }
    }
}
