using System;
using System.Collections;
using UnityEngine;

public class SuspicionMarker : MonoBehaviour
{

    void OnEnable()
    {
        GetComponent<Renderer>().enabled = true;
        Debug.Log(gameObject.name);
    }


    public void DelayedMark(bool enable)
    {
        StartCoroutine(WaitAndMark(enable));
    }

    private IEnumerator WaitAndMark(bool enable)
    {        
        yield return new WaitForSeconds(2.0f);
        GetComponent<Renderer>().enabled = enable;
        if (enable)
        {
            yield return new WaitForSeconds(15.0f);
            GetComponent<Renderer>().enabled = false;
        }
    }
}