using UnityEngine;

namespace Game
{
	public class ImageInfoModule : MonoBehaviour
	{
		[SerializeField] private ScreenController screenController;
		[SerializeField] private SpriteRenderer spriteRenderer;

		public void Activate()
		{
			spriteRenderer.color = new Color(1, 1f, 1, 0);
			spriteRenderer.sprite = screenController.CurrentScreen.ImageInfo;
			gameObject.SetActive(true);

			LeanTween.cancel(spriteRenderer.gameObject);
			LeanTween.alpha(spriteRenderer.gameObject, 1f, ScreenController.FadeInDuration);
		}

		public void Deactivate()
		{
			LeanTween.cancel(spriteRenderer.gameObject);
			LeanTween.alpha(spriteRenderer.gameObject, 0f, ScreenController.FadeInDuration);
		}
	}
}