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

public class PosLookPhase : AbstractPhase
{
    private static PosLookPhase _instance;
    public static PosLookPhase Instance
    {
        get
        {
            return _instance;
        }
    }

    public Animator mFadeAnimator, mSketchAnimator;
    public GameObject mReady, mFlashback, mBackgroundLookPhase;

    private void Awake()
    {
        _instance = this;
    }

    public override void BeginPhase()
    {
        TimerGame.Instance.TimeClosedEvent += EndPhase;
        TimerGame.Instance.StartTime(2); //voltar para 10
        mFadeAnimator.Play("FadeIn");
    }

    public override void EndPhase()
    {
        TimerGame.Instance.TimeClosedEvent -= EndPhase;
        mReady.SetActive(true);
    }

    public void StartDrawPhase()
    {
        mFlashback.SetActive(false);
        mReady.SetActive(false);
        ControlProgressManager.Instance.mCurrentPhase++;
        ControlProgressManager.Instance.RunningProgress();
        mBackgroundLookPhase.SetActive(false);
        mFadeAnimator.gameObject.SetActive(false);
        mSketchAnimator.Play("Sketch_In");
    }
}
