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

public class DrawPhase : AbstractPhase {

    private static DrawPhase _instance;
    public static DrawPhase Instance
    {
        get
        {
            return _instance;
        }
    }

    public GameObject /*mSketch,*/ mPainter;

    private void Awake()
    {
        _instance = this;
    }

    public override void BeginPhase()
    {
        TimerGame.Instance.TimeClosedEvent += EndPhase;
        CameraManager.Instance.PerspGameObj.SetActive(false);
        CameraManager.Instance.CanvasOver.SetActive(false);
        mPainter.SetActive(true);
        CameraManager.Instance.OrtGameObj.SetActive(true);
        CameraManager.Instance.CanvasSpace.SetActive(true);
        TimerGame.Instance.StartTime(90);
        Painter.Instance.enabled = true;
    }

    public override void EndPhase()
    {
        Painter.Instance.enabled = false;
        SoundEffectsPlayer.Instance.Stop("sfx-ilha-swipe"); //mudar para botao do lapis

        ControlProgressManager.Instance.mCurrentPhase++;
        ControlProgressManager.Instance.RunningProgress();
    }

    public void StartPosDrawPhase()
    {
        SoundEffectsPlayer.Instance.Play("sfx-tile-efeito-verde"); //mudar para botao
        TimerGame.Instance.Interrupt();
        Painter.Instance.ExportToRawImg();
    }
}
