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

public class end : MonoBehaviour {
	private bool isPhoto = false;
	public Texture2D img;
	private Camera mCam;
	// Use this for initialization
	void Start () {
		mCam = GameObject.Find ("Main Camera").GetComponent<Camera>();
		if (ItemManager.count > 0) {
			gameObject.GetComponent<SpriteRenderer> ().enabled = false;
		} else if(ItemManager.count <= 0) {
			Invoke ("show", 25);
		}
		ItemManager.count = 5;
	}
	
	void show(){
		isPhoto = true;
	}
	void OnGUI(){
		if (isPhoto)
			GUI.DrawTexture (mCam.pixelRect, img, ScaleMode.ScaleToFit, true);
	}

}
