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

public class WindowBreakControl : MonoBehaviour
{
    public AudioClip CrackSoundEffect;
    public AudioClip BrokeSoundEffect;
    public int CurrentTapCount;
    public List<Sprite> WindownSprites;
    public UnityEngine.UI.Image Image;


    public void TapWindow()
    {
        if (GameplayManager.Instance.Loading)
        {
            return;
        }
        if (CurrentTapCount < 12)
        {
            Image.sprite = WindownSprites[CurrentTapCount];
        }
        CurrentTapCount++;
        if (CurrentTapCount < 12)
        {
            AudioManager.Instance.PlaySoundEffect(CrackSoundEffect);
        }
        if (CurrentTapCount == 12)
        {
            AudioManager.Instance.PlaySoundEffect(BrokeSoundEffect);
        }

    }
}
