using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class BackGroundView : MonoBehaviour
{
    public static BackGroundView intance;

    [SerializeField] Image GoalCheckImage;
    [SerializeField] Sprite Goal;
    [SerializeField] Sprite Miss;
    private void Awake()
    {
        intance = this;
    }
    public void ShowCheckImage(bool isGool)
    {
        GoalCheckImage.gameObject.SetActive(true);
        if (isGool)
        {
            GoalCheckImage.sprite = Goal;
        }
        GoalCheckImage.rectTransform.localPosition = new Vector3(-500, GoalCheckImage.rectTransform.localPosition.y, GoalCheckImage.rectTransform.localPosition.z);
        GoalCheckImage.rectTransform.DOLocalMove(new Vector3(0, GoalCheckImage.rectTransform.localPosition.y, GoalCheckImage.rectTransform.localPosition.z), 0.25f)
            .SetEase(Ease.OutQuad).OnComplete(()=> {
                StartCoroutine(TurnOff());
            });
    }
    IEnumerator TurnOff()
    {
        yield return new WaitForSeconds(1f);
        GoalCheckImage.gameObject.SetActive(false);

    }
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
