<repo_name>gustaandrade/MaoNaMassa<file_sep>/Assets/Scripts/GameConstants.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameConstants : MonoBehaviour
{
	// Tags gerais
	public const string PLAYER_TAG = "Player";
	public const string LEVEL_TAG = "Level";
	public const string DIALOGO_TAG = "Dialogo";

	// Valores gerais
	public const float PLAYER_SPEED = 2.5F;

	// Valores de cena para o Tutorial
	public const int ANIM_LIVRO_ON = 4;
	public const int ANIM_LIVRO_OFF = 5;

	public const int PASSO1_TUTORIAL = 13;
	// Pegar água na geladeira
	public const int PASSO2_TUTORIAL = 18;
	// Levar água para mesa central da neta
	public const int PASSO3_TUTORIAL = 21;
	// Pegar água da mesa central da vovó
	public const int PASSO4_TUTORIAL = 22;
	// Levar a água para o fogão
	public const int PASSO5_TUTORIAL = 25;
	// Pegar gelatina no armário
	public const int PASSO6_TUTORIAL = 26;
	// Levar gelatina para mesa central da neta
	public const int PASSO7_TUTORIAL = 28;
	// Buscar água quente no fogão
	public const int PASSO8_TUTORIAL = 29;
	// Levar água quente para a mesa central da vovó
	public const int PASSO9_TUTORIAL = 30;
	// Buscar água fria da geladeira
	public const int PASSO10_TUTORIAL = 31;
	// Levar água fria para a mesa central da neta
	public const int PASSO11_TUTORIAL = 33;
	// Misturar ingredientes na mesa central
	public const int PASSO12_TUTORIAL = 35;
	// Levar gelatina para a geladeira
	public const int PASSO36_TUTORIAL = 36;
	// CursorDaGeladeiraFinal
	public const int PASSOFINAL_TUTORIAL = 40;
	// Último diálogo do tutorial

	public const int VALOR_FORNO = 0;
	public const int VALOR_FOGAO = 1;
	public const int VALOR_MESAVOVO = 2;
	public const int VALOR_ARMARIO = 3;
	public const int VALOR_GELADEIRA = 4;
	public const int VALOR_PIA = 5;
	public const int VALOR_MESANETA = 6;


	// Valores de cena para a Receita 2
	public const int COUNT_INICIO_RECEITA2 = 9;


	// Valores de cena para a Receita 3
	public const int COUNT_INICIO_RECEITA3 = 9;
}
<file_sep>/Assets/Scripts/Menu.cs
﻿using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class Menu : MonoBehaviour
{

	public string Tutorial;
	public string Creditos;
	public string Receitas;

	public void NewGame ()
	{
		SceneManager.LoadScene (Tutorial);
	}

	public void Receita ()
	{
		SceneManager.LoadScene (Receitas);
	}

	public void CreditsScene ()
	{
		SceneManager.LoadScene (Creditos);
	}

	public void Voltar ()
	{
		SceneManager.LoadScene (1);
	}

	public void QuitGame ()
	{
		Application.Quit ();
	}
}<file_sep>/Assets/Scripts/MudaPagina.cs
﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class MudaPagina : MonoBehaviour
{
	public GameObject livro;
	public GameObject objLivro;
	public GameObject objCreditos;
	public GameObject objSair;

	private Image imgLivro;

	private int flag1 = 0;
	private bool flag2 = true;
	private bool flag3 = true;
	private bool flag4 = true;

	public Sprite gelatina;
	public Sprite bolinho;
	public Sprite chocolate;

	void Start ()
	{
		imgLivro = livro.GetComponent<Image> ();
	}

	public void TrocarReceita ()
	{
		flag1++;
		if (flag1 == 3)
			flag1 = 0;
		
		if (flag1 == 0) {
			imgLivro.sprite = gelatina;
		} else if (flag1 == 1) {
			imgLivro.sprite = bolinho;
		} else if (flag1 == 2) {
			imgLivro.sprite = chocolate;
		}
	}

	public void TrocarCanvasReceita ()
	{
		if (!flag2) {
			objLivro.SetActive (false);
			flag2 = true;
		} else {
			objLivro.SetActive (true);
			flag2 = false;
		}
	}

	public void TrocarCanvasInfo ()
	{
		if (!flag3) {
			objCreditos.SetActive (false); 
			flag3 = true;
		} else {
			objCreditos.SetActive (true);
			flag3 = false;
		}
	}

	public void TrocarCanvasSair ()
	{
		if (!flag4) {
			objSair.SetActive (false); 
			flag4 = true;
		} else {
			objSair.SetActive (true);
			flag4 = false;
		}
	}

	public void LoadReceita ()
	{
		if (flag1 == 0) {
			SceneManager.LoadScene (2);
		} else if (flag1 == 1) {
			SceneManager.LoadScene (4);
		} else if (flag1 == 2) {
			SceneManager.LoadScene (5);
		}
	}
}<file_sep>/Assets/Scripts/Pause.cs
﻿using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class Pause : MonoBehaviour {

	public string Menu;

	public AudioSource soundManager;

	public GameObject thePauseScreen;

	public GameObject toqueCollider;


	void Start () {
		soundManager = GameObject.Find ("SoundManager").GetComponent<AudioSource>();
	}
		
	void Update () {
		if(Input.GetButtonDown("Pause"))
		{
			if(Time.timeScale == 0f)
			{
				ResumeGame();
			} else {
				PauseGame();
			}
		}
	}

	public void PauseGame()
	{
		Time.timeScale = 0;

		thePauseScreen.SetActive(true);
		toqueCollider.SetActive (false);
		soundManager.Pause();
	}

	public void ResumeGame()
	{
		thePauseScreen.SetActive(false);

		Time.timeScale = 1f;

		toqueCollider.SetActive (true);
		soundManager.Play ();
	}


	public void QuitToMainMenu()
	{
		Time.timeScale = 1f;
		SceneManager.LoadScene(Menu);
	}
}<file_sep>/Assets/Scripts/DialogControl.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class DialogControl : MonoBehaviour
{
	public GameObject dialogos;
	private Transform log;
	private Text[] vetorDialogos;
	private int numDialogos;

	public GameObject canvasLivro;
	private Animator livro;
	public Button next;

	public int count;

	public GameObject aguafria1;
	public GameObject aguafria2;
	public GameObject aguafria3;
	public GameObject aguafria4;
	public GameObject aguaquente1;
	public GameObject aguaquente2;
	public GameObject aguavermelha;
	public GameObject bowl;
	public GameObject pogelatina1;
	public GameObject pogelatina2;
	public GameObject gelatinafinal;

	public GameObject btnMix;
	public Button btnNext;

	/**************** RECEITA 2 *****************/

	public TutorialControl receita;
	public GameObject canvasDialogo;

	public AudioSource etapaSom;
	public AudioClip etapaSon;
	private bool soundPlayed = false;


	void Start ()
	{
		etapaSom = GetComponent<AudioSource> ();

		log = dialogos.GetComponent<Transform> ();
		numDialogos = log.childCount; 
		vetorDialogos = new Text[numDialogos];


		for (int i = 0; i < numDialogos; i++) {
			vetorDialogos [i] = log.GetChild (i).gameObject.GetComponent<Text> ();
		}

		livro = canvasLivro.GetComponent<Animator> ();
	}

	void Update ()
	{
		ChangeDialog ();
	}

	public void ChangeDialog ()
	{
		/**************** RECEITA 1 *****************/

		if (SceneManager.GetActiveScene ().buildIndex == 2) {
			if (count == GameConstants.ANIM_LIVRO_ON) {
				livro.Play ("anim_fadein_livro");
			}
			if (count == GameConstants.ANIM_LIVRO_OFF) {
				livro.Play ("anim_fadeout_livro");
			}
			if (count == GameConstants.PASSO1_TUTORIAL
			    || count == GameConstants.PASSO2_TUTORIAL
			    || count == GameConstants.PASSO3_TUTORIAL
			    || count == GameConstants.PASSO4_TUTORIAL
			    || count == GameConstants.PASSO5_TUTORIAL
			    || count == GameConstants.PASSO6_TUTORIAL
			    || count == GameConstants.PASSO7_TUTORIAL
			    || count == GameConstants.PASSO8_TUTORIAL
			    || count == GameConstants.PASSO9_TUTORIAL
			    || count == GameConstants.PASSO10_TUTORIAL
			    || count == GameConstants.PASSO11_TUTORIAL
			    || count == GameConstants.PASSO12_TUTORIAL) {
				next.interactable = false;
			}

			if (count == GameConstants.PASSO1_TUTORIAL + 1) {
				aguafria1.SetActive (true);

				if (!soundPlayed) {
					etapaSom.PlayOneShot (etapaSon);
					soundPlayed = true;
				}

			} else if (count == GameConstants.PASSO2_TUTORIAL + 1) {
				aguafria1.SetActive (false);
				aguafria2.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO3_TUTORIAL + 1) {
				aguafria2.SetActive (false);
				aguafria4.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO4_TUTORIAL + 1) {
				aguafria4.SetActive (false);
				aguafria3.SetActive (true);

				TocarSom ();

			} else if (count == 24) {
				aguafria3.SetActive (false);
				aguaquente1.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO5_TUTORIAL + 1) {
				aguafria3.SetActive (false);
				pogelatina1.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO6_TUTORIAL + 1) {
				pogelatina1.SetActive (false);
				pogelatina2.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO8_TUTORIAL + 1) {
				aguaquente1.SetActive (false);
				aguaquente2.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO9_TUTORIAL + 1) {
				aguafria1.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO10_TUTORIAL + 1) {
				aguafria1.SetActive (false);
				aguafria2.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSO11_TUTORIAL) {
				btnMix.SetActive (true);

			} else if (count == GameConstants.PASSO11_TUTORIAL + 1) {
				btnMix.SetActive (false);
				btnNext.interactable = true;
				aguafria2.SetActive (false);
				aguaquente2.SetActive (false);
				pogelatina2.SetActive (false);
				bowl.SetActive (false);
				aguavermelha.SetActive (true);


			} else if (count == GameConstants.PASSO12_TUTORIAL + 1) {
				aguavermelha.SetActive (false);
				gelatinafinal.SetActive (true);

				TocarSom ();

			} else if (count == GameConstants.PASSOFINAL_TUTORIAL) {
				SceneManager.LoadScene (3);
			}
		}

		/**************** RECEITA 2 *****************/

		else if (SceneManager.GetActiveScene ().buildIndex == 4) {
			if (count == GameConstants.ANIM_LIVRO_ON) {
				livro.Play ("anim_fadein_livro");
			}
			if (count == GameConstants.ANIM_LIVRO_OFF) {
				livro.Play ("anim_fadeout_livro");
			}

			if (count == GameConstants.COUNT_INICIO_RECEITA2) {
				receita.SetAllBoxesTrue ();
				canvasDialogo.GetComponent<Canvas> ().enabled = false;
			}
		} 


		/**************** RECEITA 3 *****************/


		else if (SceneManager.GetActiveScene ().buildIndex == 5) {
			if (count == GameConstants.ANIM_LIVRO_ON) {
				livro.Play ("anim_fadein_livro");
			}
			if (count == GameConstants.ANIM_LIVRO_OFF) {
				livro.Play ("anim_fadeout_livro");
			}

			if (count == GameConstants.COUNT_INICIO_RECEITA3) {
				receita.SetAllBoxesTrue ();
				canvasDialogo.GetComponent<Canvas> ().enabled = false;
			}
		}
	}

	public void SetCount ()
	{
		count++;
		vetorDialogos [count - 1].GetComponent<Animator> ().Play ("anim_fadeout_text");
		vetorDialogos [count - 1].enabled = false;
		vetorDialogos [count].GetComponent<Animator> ().Play ("anim_fadein_text");
		vetorDialogos [count].enabled = true;
		Debug.Log (count);

		soundPlayed = false;
	}

	public int GetCount ()
	{
		return count;
	}

	public void TocarSom ()
	{
		if (!soundPlayed) {
			etapaSom.PlayOneShot (etapaSon);
			soundPlayed = true;
		}
	}

}
<file_sep>/Assets/Scripts/Tap.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TouchScript.Gestures;

public class Tap : MonoBehaviour
{

	private TapGesture gesture;
	public PlayerController player;

	// Use this for initialization
	void Awake ()
	{
		gesture = GetComponent<TapGesture> ();
	}
	
	// Update is called once per frame
	void TapHandler (object sender, System.EventArgs e)
	{
		player.EscolherDestino (gameObject.name);
	}

	public void OnEnable ()
	{
		gesture.Tapped += TapHandler;
	}

	public void OnDisable ()
	{
		gesture.Tapped -= TapHandler;
	}
}
<file_sep>/Assets/Scripts/SplashScreen.cs
﻿using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class SplashScreen : MonoBehaviour {

	public float timer = 4f;
	public string Menu;

	void Start()
	{
		StartCoroutine ("LoadMenu");
	}

	IEnumerator LoadMenu() 
	{
		yield return new WaitForSeconds (timer);
		SceneManager.LoadScene(Menu);
	}
}
<file_sep>/Assets/Scripts/PlayerController.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class PlayerController : MonoBehaviour
{
	/**************** RECEITA 1 *****************/

	public Transform posicaoFogao;
	public Transform posicaoForno;
	public Transform posicaoMesaVovo;

	public Transform posicaoArmario;
	public Transform posicaoGeladeira;
	public Transform posicaoPia;
	public Transform posicaoMesaNeta;

	private Transform destino1;
	private Transform destino2;
	public Transform origDestino1;
	public Transform origDestino2;

	public GameObject player1;
	public GameObject player2;

	private bool flagMover1 = false;
	private bool flagMover2 = false;

	public TutorialControl tutorial;

	private Transform[] numeroPosicoes;

	private Animator animVo;
	private Animator animNeta;

	private BoxCollider2D boxVo;
	private BoxCollider2D boxNeta;


	#region DECLARAÇÕES RECEITA 2

	/**************** RECEITA 2 *****************/


	public GameObject canvasArmario;
	public GameObject canvasGeladeira;
	public GameObject btnAcucar;
	public GameObject btnFarinha;
	public GameObject btnOleo;
	public GameObject btnOvo;
	public GameObject btnLeite;
	public GameObject btnMix;

	private bool flagEtapa1 = false;
	private bool flagEtapa2 = false;
	private bool flagEtapa3 = false;

	public GameObject ovos;
	public GameObject farinha;
	public GameObject leite;
	public GameObject oleo1;
	public GameObject oleo2;
	public GameObject massa1;
	public GameObject massa2;
	public GameObject massa3;
	public GameObject bolinho1;
	public GameObject bolinho2;
	public GameObject bolinho3;
	public GameObject panela1;
	public GameObject panela2;
	public GameObject acucar;
	public GameObject bolinhofinal;

	public GameObject btnMix2;

	public GameObject relogio1;

	#endregion

	#region DECLARAÇÕES RECEITA 3

	/**************** RECEITA 3 *****************/

	public GameObject r3_canvasArmario;
	public GameObject r3_canvasGeladeira;
	public GameObject r3_btnAcucar1;
	public GameObject r3_btnAcucar2;
	public GameObject r3_btnFarinha;
	public GameObject r3_btnOvo;
	public GameObject r3_btnLeite;
	public GameObject r3_btnChocolate1;
	public GameObject r3_btnChocolate2;
	public GameObject r3_btnManteiga1;
	public GameObject r3_btnManteiga2;
	public GameObject r3_btnFermento;
	public GameObject r3_btnCreme;

	public GameObject r3_btnMix;
	public GameObject r3_btnMix2;

	public GameObject r3_ovos;
	public GameObject r3_farinha;
	public GameObject r3_leite;
	public GameObject r3_acucar1;
	public GameObject r3_acucar2;
	public GameObject r3_acucar3;
	public GameObject r3_fermento;
	public GameObject r3_manteiga1;
	public GameObject r3_manteiga2;
	public GameObject r3_manteiga3;
	public GameObject r3_chocolate1;
	public GameObject r3_chocolate2;
	public GameObject r3_chocolate3;
	public GameObject r3_massaBolo1;
	public GameObject r3_massaBolo2;
	public GameObject r3_bolo1;
	public GameObject r3_bolo2;
	public GameObject r3_creme1;
	public GameObject r3_creme2;
	public GameObject r3_panela1;
	public GameObject r3_panela2;
	public GameObject r3_calda;
	public GameObject r3_boloFinal;

	public GameObject relogio2;
	public GameObject relogio3;

	private bool flagEtapa1_R3 = false;
	private bool flagEtapa2_R3 = false;
	private bool flagEtapa3_R3 = false;
	private bool flagEtapa4_R3 = false;
	private bool flagEtapa5_R3 = false;
	private bool flagEtapa6_R3 = false;


	#endregion

	#region DECLARAÇÕES CANVASCHEERS PARA R2 E R3

	public GameObject canvasCheers;

	public GameObject txtr2_1;
	public GameObject txtr2_2;
	public GameObject txtr2_3;
	public GameObject btnFim1;

	public GameObject txtr3_1;
	public GameObject txtr3_2;
	public GameObject txtr3_3;
	public GameObject btnFim2;

	#endregion

	void Start ()
	{
		Input.multiTouchEnabled = true;
		destino1 = origDestino1;
		destino2 = origDestino2;

		numeroPosicoes = new Transform[7];
		numeroPosicoes [0] = posicaoForno;
		numeroPosicoes [1] = posicaoFogao;
		numeroPosicoes [2] = posicaoMesaVovo;
		numeroPosicoes [3] = posicaoArmario;
		numeroPosicoes [4] = posicaoGeladeira;
		numeroPosicoes [5] = posicaoPia;
		numeroPosicoes [6] = posicaoMesaNeta;
	}

	void Update ()
	{
		MoverPersonagem ();
	}

	public void EscolherDestino (string name)
	{
		if (name == "Forno") {
			destino1 = posicaoForno;

			if (SceneManager.GetActiveScene ().buildIndex == 5) {
				LevarForno_R3 ();
			}

			AnimeVovo (1);
			flagMover1 = true;

		} else if (name == "Fogao") {
			destino1 = posicaoFogao;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				LevarFogao ();
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				LevarFogao_R3 ();
			}

			AnimeVovo (2);
			flagMover1 = true;

		} else if (name == "MesaVovo") {
			destino1 = posicaoMesaVovo;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				PegarMesa ();
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				PegarMesa_R3 ();
			}

			AnimeVovo (3);
			flagMover1 = true;
		}

		if (name == "Armario") {
			destino2 = posicaoArmario;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				canvasArmario.GetComponent<Canvas> ().enabled = true;
				canvasGeladeira.GetComponent<Canvas> ().enabled = false;
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				r3_canvasArmario.GetComponent<Canvas> ().enabled = true;
				r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
			}

			AnimeNeta (3);
			flagMover2 = true;

		} else if (name == "Geladeira") {
			destino2 = posicaoGeladeira;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				canvasArmario.GetComponent<Canvas> ().enabled = false;
				canvasGeladeira.GetComponent<Canvas> ().enabled = true;
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
				r3_canvasGeladeira.GetComponent<Canvas> ().enabled = true;
			}

			AnimeNeta (1);
			flagMover2 = true;

		} else if (name == "Pia") {
			destino2 = posicaoPia;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				canvasArmario.GetComponent<Canvas> ().enabled = false;
				canvasGeladeira.GetComponent<Canvas> ().enabled = false;
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
				r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
			}

			AnimeNeta (3);
			flagMover2 = true;

		} else if (name == "MesaNeta") {
			destino2 = posicaoMesaNeta;

			if (SceneManager.GetActiveScene ().buildIndex == 4) {
				canvasArmario.GetComponent<Canvas> ().enabled = false;
				canvasGeladeira.GetComponent<Canvas> ().enabled = false;
				ColocarNaMesa ();
			} else if (SceneManager.GetActiveScene ().buildIndex == 5) {
				r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
				r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
				ColocarNaMesa_R3 ();
			}

			AnimeNeta (2);
			flagMover2 = true;
		}
	}

	public void MoverPersonagem ()
	{  
		if (flagMover1) {
			player1.transform.position = Vector3.MoveTowards (player1.transform.position, destino1.position, GameConstants.PLAYER_SPEED * Time.deltaTime);

			if (Vector3.Distance (player1.transform.position, destino1.position) < 0.1) {
				AnimeVovo (5);
				tutorial.SetFlagMover1 ();
				flagMover1 = false;
			}
		} 
		
		if (flagMover2) {
			player2.transform.position = Vector3.MoveTowards (player2.transform.position, destino2.position, GameConstants.PLAYER_SPEED * Time.deltaTime);

			if (Vector3.Distance (player2.transform.position, destino2.position) < 0.1) {
				AnimeNeta (5);
				tutorial.SetFlagMover2 ();
				flagMover2 = false;
			}	
		}
	}

	public void AnimeVovo (int i)
	{
		if (i == 1) {
			player1.GetComponent<Animator> ().SetBool ("isWest", false);
			player1.GetComponent<Animator> ().SetBool ("isEast", false);
			player1.GetComponent<Animator> ().SetBool ("isSouth", false);
			player1.GetComponent<Animator> ().SetBool ("isNorth", true);
		}
		if (i == 2) {
			player1.GetComponent<Animator> ().SetBool ("isNorth", false);
			player1.GetComponent<Animator> ().SetBool ("isEast", false);
			player1.GetComponent<Animator> ().SetBool ("isSouth", false);
			player1.GetComponent<Animator> ().SetBool ("isWest", true);
		}
		if (i == 3) {
			player1.GetComponent<Animator> ().SetBool ("isNorth", false);
			player1.GetComponent<Animator> ().SetBool ("isWest", false);
			player1.GetComponent<Animator> ().SetBool ("isSouth", false);
			player1.GetComponent<Animator> ().SetBool ("isEast", true);
		}
		if (i == 4) {
			player1.GetComponent<Animator> ().SetBool ("isNorth", false);
			player1.GetComponent<Animator> ().SetBool ("isWest", false);
			player1.GetComponent<Animator> ().SetBool ("isEast", false);
			player1.GetComponent<Animator> ().SetBool ("isSouth", true);
		}
		if (i == 5) {
			player1.GetComponent<Animator> ().SetBool ("isNorth", false);
			player1.GetComponent<Animator> ().SetBool ("isWest", false);
			player1.GetComponent<Animator> ().SetBool ("isEast", false);
			player1.GetComponent<Animator> ().SetBool ("isSouth", false);
		}
	}

	public void AnimeNeta (int i)
	{
		if (i == 1) {
			player2.GetComponent<Animator> ().SetBool ("isWest", false);
			player2.GetComponent<Animator> ().SetBool ("isEast", false);
			player2.GetComponent<Animator> ().SetBool ("isSouth", false);
			player2.GetComponent<Animator> ().SetBool ("isNorth", true);
		}
		if (i == 2) {
			player2.GetComponent<Animator> ().SetBool ("isNorth", false);
			player2.GetComponent<Animator> ().SetBool ("isEast", false);
			player2.GetComponent<Animator> ().SetBool ("isSouth", false);
			player2.GetComponent<Animator> ().SetBool ("isWest", true);
		}
		if (i == 3) {
			player2.GetComponent<Animator> ().SetBool ("isNorth", false);
			player2.GetComponent<Animator> ().SetBool ("isWest", false);
			player2.GetComponent<Animator> ().SetBool ("isSouth", false);
			player2.GetComponent<Animator> ().SetBool ("isEast", true);
		}
		if (i == 4) {
			player2.GetComponent<Animator> ().SetBool ("isNorth", false);
			player2.GetComponent<Animator> ().SetBool ("isWest", false);
			player2.GetComponent<Animator> ().SetBool ("isEast", false);
			player2.GetComponent<Animator> ().SetBool ("isSouth", true);
		}
		if (i == 5) {
			player2.GetComponent<Animator> ().SetBool ("isNorth", false);
			player2.GetComponent<Animator> ().SetBool ("isWest", false);
			player2.GetComponent<Animator> ().SetBool ("isEast", false);
			player2.GetComponent<Animator> ().SetBool ("isSouth", false);
		}
	}

	#region FUNÇÕES RECEITA 2

	/**************** RECEITA 2 *****************/


	public void EscolherItem1 ()
	{
		btnAcucar.SetActive (false);
		canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem2 ()
	{
		btnFarinha.SetActive (false);
		canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem3 ()
	{
		btnOleo.SetActive (false);
		canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem4 ()
	{
		btnOvo.SetActive (false);
		canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem5 ()
	{
		btnLeite.SetActive (false);
		canvasGeladeira.GetComponent<Canvas> ().enabled = false;
	}

	public void ColocarNaMesa ()
	{
		if (!flagEtapa1) {
			if (btnOvo.activeInHierarchy == false) {
				ovos.SetActive (true);
			}
			if (btnFarinha.activeInHierarchy == false) {
				farinha.SetActive (true);
			}
			if (btnLeite.activeInHierarchy == false) {
				leite.SetActive (true);
			}
			if (btnOleo.activeInHierarchy == false) {
				oleo1.SetActive (true);
			}
			if (btnAcucar.activeInHierarchy == false) {
				acucar.SetActive (true);
			}

			if (btnAcucar.activeInHierarchy == false && btnFarinha.activeInHierarchy == false &&
			    btnOleo.activeInHierarchy == false && btnOvo.activeInHierarchy == false &&
			    btnLeite.activeInHierarchy == false) {
				btnMix.SetActive (true);
				StartCoroutine (CheersR2 (1));
			}
		}
	}

	public void MisturarIngredientes ()
	{
		StartCoroutine (Rotina ());
	}

	IEnumerator Rotina ()
	{
		flagEtapa1 = true;
		btnMix.SetActive (false);
		ovos.SetActive (false);
		farinha.SetActive (false);
		leite.SetActive (false);
		massa1.SetActive (true);
		yield return new WaitForSecondsRealtime (3);
		massa1.SetActive (false);
		massa2.SetActive (true);
	}

	public void PegarMesa ()
	{
		if (massa2.activeInHierarchy == true) {
			oleo1.SetActive (false);
			massa2.SetActive (false);
			flagEtapa2 = true;
		}
		if (flagEtapa3) {
			panela1.SetActive (false);
			bolinho2.SetActive (false);
			panela2.SetActive (true);
			bolinho3.SetActive (true);
			btnMix2.SetActive (true);
			flagEtapa3 = false;
		}
	}

	public void LevarFogao ()
	{
		if (flagEtapa2) {
			tutorial.SetBoxFalse (1);
			oleo2.SetActive (true);
			massa3.SetActive (true);
			StartCoroutine (FritarBolinho ());
		}
	}

	IEnumerator FritarBolinho ()
	{
		yield return new WaitForSecondsRealtime (3);
		relogio1.SetActive (true);
		oleo2.SetActive (false);
		massa3.SetActive (false);
		//panela1.SetActive (true);
		bolinho1.SetActive (true);
		StartCoroutine (CheersR2 (2));
		yield return new WaitForSecondsRealtime (3);
		relogio1.SetActive (false);
		bolinho1.SetActive (false);
		bolinho2.SetActive (true);
		flagEtapa2 = false;
		flagEtapa3 = true;
	}

	public void TerminarReceita ()
	{
		acucar.SetActive (false);
		panela2.SetActive (false);
		bolinho3.SetActive (false);
		btnMix2.SetActive (false);
		bolinhofinal.SetActive (true);
		StartCoroutine (CheersR2 (3));
	}

	IEnumerator CheersR2 (int num)
	{
		canvasCheers.SetActive (true);

		if (num == 1) {
			txtr2_1.SetActive (true);
			yield return new WaitForSecondsRealtime (3);
			canvasCheers.SetActive (false);
		} else if (num == 2) {
			txtr2_1.SetActive (false);
			txtr2_2.SetActive (true);
			yield return new WaitForSecondsRealtime (3);
			canvasCheers.SetActive (false);
		} else if (num == 3) {
			txtr2_2.SetActive (false);
			txtr2_3.SetActive (true);
			btnFim1.SetActive (true);
		}
	}

	#endregion

	/**************** RECEITA 3 *****************/

	#region FUNÇÕES RECEITA 3

	public void EscolherItem1_R3 ()
	{
		r3_btnChocolate1.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem2_R3 ()
	{
		r3_btnFarinha.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem3_R3 ()
	{
		r3_btnOvo.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem4_R3 ()
	{
		r3_btnFermento.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem5_R3 ()
	{
		r3_btnAcucar1.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem6_R3 ()
	{
		r3_btnManteiga1.SetActive (false);
		r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem7_R3 ()
	{
		r3_btnLeite.SetActive (false);
		r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem8_R3 ()
	{
		r3_btnChocolate2.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem9_R3 ()
	{
		r3_btnCreme.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem10_R3 ()
	{
		r3_btnAcucar2.SetActive (false);
		r3_canvasArmario.GetComponent<Canvas> ().enabled = false;
	}

	public void EscolherItem11_R3 ()
	{
		r3_btnManteiga2.SetActive (false);
		r3_canvasGeladeira.GetComponent<Canvas> ().enabled = false;
	}

	public void ColocarNaMesa_R3 ()
	{
		if (!flagEtapa1_R3) {
			if (r3_btnChocolate1.activeInHierarchy == false) {
				r3_chocolate1.SetActive (true);
			}
			if (r3_btnFarinha.activeInHierarchy == false) {
				r3_farinha.SetActive (true);
			}
			if (r3_btnOvo.activeInHierarchy == false) {
				r3_ovos.SetActive (true);
			}
			if (r3_btnFermento.activeInHierarchy == false) {
				r3_fermento.SetActive (true);
			}
			if (r3_btnAcucar1.activeInHierarchy == false) {
				r3_acucar1.SetActive (true);
			}
			if (r3_btnManteiga1.activeInHierarchy == false) {
				r3_manteiga1.SetActive (true);
			}
			if (r3_btnLeite.activeInHierarchy == false) {
				r3_leite.SetActive (true);
			}

			if (r3_btnChocolate1.activeInHierarchy == false && r3_btnFarinha.activeInHierarchy == false &&
			    r3_btnOvo.activeInHierarchy == false && r3_btnFermento.activeInHierarchy == false &&
			    r3_btnAcucar1.activeInHierarchy == false && r3_btnManteiga1.activeInHierarchy == false &&
			    r3_btnLeite.activeInHierarchy == false) {
				r3_btnMix.SetActive (true);
			}
		} 

		if (r3_bolo2.activeInHierarchy == true) {
			if (r3_btnChocolate2.activeInHierarchy == false) {
				r3_chocolate2.SetActive (true);
			}
			if (r3_btnAcucar2.activeInHierarchy == false) {
				r3_acucar2.SetActive (true);
			}
			if (r3_btnManteiga2.activeInHierarchy == false) {
				r3_manteiga2.SetActive (true);
			}
			if (r3_btnCreme.activeInHierarchy == false) {
				r3_creme1.SetActive (true);
			}

			if (r3_btnChocolate2.activeInHierarchy == false && r3_btnAcucar2.activeInHierarchy == false &&
			    r3_btnManteiga2.activeInHierarchy == false && r3_btnCreme.activeInHierarchy == false) {
				flagEtapa5_R3 = true;
			}
		}
	}

	public void MisturarIngredientes_R3 ()
	{
		flagEtapa1_R3 = true;
		r3_btnMix.SetActive (false);
		r3_ovos.SetActive (false);
		r3_chocolate1.SetActive (false);
		r3_manteiga1.SetActive (false);
		r3_farinha.SetActive (false);
		r3_acucar1.SetActive (false);
		r3_leite.SetActive (false);
		r3_fermento.SetActive (false);
		r3_massaBolo1.SetActive (true);

		StartCoroutine (CheersR3 (1));
	}

	public void PegarMesa_R3 ()
	{
		if (r3_massaBolo1.activeInHierarchy == true) {
			r3_massaBolo1.SetActive (false);
			flagEtapa2_R3 = true;
		}
		if (flagEtapa3_R3) {
			r3_bolo1.SetActive (false);
			r3_bolo2.SetActive (true);
			StartCoroutine (CheersR3 (2));
			flagEtapa3_R3 = false;
			flagEtapa4_R3 = true;
			LigarElementosCalda ();
		}
		if (r3_bolo2.activeInHierarchy == true && r3_chocolate2.activeInHierarchy == true &&
		    r3_acucar2.activeInHierarchy == true && r3_manteiga2.activeInHierarchy == true &&
		    r3_creme1.activeInHierarchy == true) {
			r3_chocolate2.SetActive (false);
			r3_acucar2.SetActive (false);
			r3_manteiga2.SetActive (false);
			r3_creme1.SetActive (false);
			flagEtapa5_R3 = true;
		}
		if (flagEtapa6_R3) {
			r3_panela2.SetActive (false);
			r3_calda.SetActive (true);
			r3_btnMix2.SetActive (true);
			tutorial.SetBoxFalse (2);
			tutorial.SetBoxFalse (5);
		}
	}

	public void LevarForno_R3 ()
	{
		if (flagEtapa2_R3) {
			r3_massaBolo2.SetActive (true);
			StartCoroutine (AssarBolo ());
		}
	}

	public IEnumerator AssarBolo ()
	{
		tutorial.SetBoxFalse (0);
		yield return new WaitForSecondsRealtime (3); 
		relogio2.SetActive (true);
		r3_massaBolo2.SetActive (false);
		yield return new WaitForSecondsRealtime (3);
		relogio2.SetActive (false);
		r3_bolo1.SetActive (true);
		flagEtapa2_R3 = false;
		flagEtapa3_R3 = true;
	}

	public void LigarElementosCalda ()
	{
		if (flagEtapa4_R3) {
			r3_btnChocolate2.SetActive (true);
			r3_btnAcucar2.SetActive (true);
			r3_btnManteiga2.SetActive (true);
			r3_btnCreme.SetActive (true);
		}
	}

	public void LevarFogao_R3 ()
	{
		if (flagEtapa5_R3) {
			r3_chocolate3.SetActive (true);
			r3_acucar3.SetActive (true);
			r3_manteiga3.SetActive (true);
			r3_creme2.SetActive (true);
			StartCoroutine (FazerCalda ());
		}
	}

	IEnumerator FazerCalda ()
	{
		tutorial.SetBoxFalse (1);
		yield return new WaitForSecondsRealtime (3);
		relogio3.SetActive (true);
		r3_chocolate3.SetActive (false);
		r3_acucar3.SetActive (false);
		r3_manteiga3.SetActive (false);
		r3_creme2.SetActive (false);
		yield return new WaitForSecondsRealtime (3);
		relogio3.SetActive (false);
		r3_panela1.SetActive (false);
		r3_panela2.SetActive (true);
		flagEtapa6_R3 = true;
	}

	public void TerminarReceita_R3 ()
	{
		r3_bolo2.SetActive (false);
		r3_calda.SetActive (false);
		r3_btnMix2.SetActive (false);
		r3_boloFinal.SetActive (true);
		StartCoroutine (CheersR3 (3));
	}

	IEnumerator CheersR3 (int num)
	{
		canvasCheers.SetActive (true);

		if (num == 1) {
			txtr3_1.SetActive (true);
			yield return new WaitForSecondsRealtime (3);
			canvasCheers.SetActive (false);
		} else if (num == 2) {
			txtr3_1.SetActive (false);
			txtr3_2.SetActive (true);
			yield return new WaitForSecondsRealtime (3);
			canvasCheers.SetActive (false);
		} else if (num == 3) {
			txtr3_2.SetActive (false);
			txtr3_3.SetActive (true);
			btnFim2.SetActive (true);
		}
	}

	#endregion
}
<file_sep>/Assets/Scripts/SceneChanger.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class SceneChanger : MonoBehaviour
{
	public void EncerrarReceita ()
	{
		SceneManager.LoadScene (3);
	}

	void Update ()
	{
		if (Input.GetKeyDown (KeyCode.F2)) {
			SceneManager.LoadScene (0);
		} 
		if (Input.GetKeyDown (KeyCode.F3)) {
			SceneManager.LoadScene (1);
		} 
		if (Input.GetKeyDown (KeyCode.F4)) {
			SceneManager.LoadScene (2);
		} 
		if (Input.GetKeyDown (KeyCode.F5)) {
			SceneManager.LoadScene (3);
		} 
		if (Input.GetKeyDown (KeyCode.F6)) {
			SceneManager.LoadScene (4);
		} 
		if (Input.GetKeyDown (KeyCode.F7)) {
			SceneManager.LoadScene (5);
		}
	}
}
<file_sep>/Assets/Scripts/SomButton.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SomButton : MonoBehaviour
{
	private AudioSource music;

	public Sprite btnOn;
	public Sprite btnOff;
	private Image btn;

	void Awake ()
	{
		music = GetComponent<AudioSource> ();
		btn = GameObject.Find ("Som").GetComponent<Image> ();
	}

	public void ChangeSound ()
	{
		if (music.mute) {
			music.mute = false;
			btn.sprite = btnOn;
		} else {
			music.mute = true;
			btn.sprite = btnOff;
		}
	}
}<file_sep>/Assets/Scripts/TrocarCanvas.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class TrocarCanvas : MonoBehaviour
{
	public GameObject canvasReceita;

	public void LigarCanvasReceita ()
	{
		canvasReceita.SetActive (true);
	}

	public void DesligarCanvasReceita ()
	{
		canvasReceita.SetActive (false);
	}

	public void LoadReceita1 ()
	{
		SceneManager.LoadScene (2);
	}

	public void LoadReceita2 ()
	{
		SceneManager.LoadScene (4);
	}

	public void LoadReceita3 ()
	{
		SceneManager.LoadScene (5);
	}
}
<file_sep>/README.md
# MaoNaMassa
Repositório para o jogo Mão na Massa, desenvolvido em Unity 2D, para a plataforma Android.
<file_sep>/Assets/Scripts/FadeControl.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class FadeControl : MonoBehaviour
{
	public Canvas intro;
	public Canvas inicio;
	public GameObject panel;

	public void Fade ()
	{
		panel.SetActive (true);
	}

	public void Off ()
	{
		intro.gameObject.SetActive (false);
		inicio.gameObject.SetActive (true);
	}

	public void Begin ()
	{
		inicio.gameObject.SetActive (false);
	}
}
<file_sep>/Assets/Scripts/TutorialControl.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class TutorialControl : MonoBehaviour
{
	public DialogControl dc;
	public Button btn;
	public PlayerController pc;

	public BoxCollider2D forno;
	public BoxCollider2D fogao;
	public BoxCollider2D mesaVovo;
	public BoxCollider2D armario;
	public BoxCollider2D geladeira;
	public BoxCollider2D pia;
	public BoxCollider2D mesaNeta;

	public bool flagMover1;
	public bool flagMover2;

	private int proximoBox1;
	private int proximoBox2;

	public GameObject btnMix;

	public SpriteRenderer cursorFogao;
	public SpriteRenderer cursorGeladeira;
	public SpriteRenderer cursorArmario;
	public SpriteRenderer cursorMesaVo;
	public SpriteRenderer cursorMesaNeta;

	private bool flagBoxes = false;

	void Update ()
	{
		if (SceneManager.GetActiveScene ().buildIndex == 2) {
			if (dc.GetCount () == GameConstants.PASSO1_TUTORIAL) {
				geladeira.enabled = true;
				cursorGeladeira.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_MESANETA);
				TestFlags (geladeira);
			} else if (dc.GetCount () == GameConstants.PASSO2_TUTORIAL) {
				cursorGeladeira.enabled = false;
				mesaNeta.enabled = true;
				cursorMesaNeta.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_ARMARIO);
				TestFlags (mesaNeta);
			} else if (dc.GetCount () == GameConstants.PASSO3_TUTORIAL) {
				cursorMesaNeta.enabled = false;
				mesaVovo.enabled = true;
				cursorMesaVo.enabled = true;
				DefinirProximoDestino1 (GameConstants.VALOR_FOGAO);
				TestFlags (mesaVovo);
			} else if (dc.GetCount () == GameConstants.PASSO4_TUTORIAL) {
				cursorMesaVo.enabled = false;
				fogao.enabled = true;
				cursorFogao.enabled = true;
				DefinirProximoDestino1 (GameConstants.VALOR_FOGAO);
				TestFlags (fogao);
			} else if (dc.GetCount () == GameConstants.PASSO5_TUTORIAL) {
				cursorFogao.enabled = false;
				armario.enabled = true;
				cursorArmario.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_MESANETA);
				TestFlags (armario);
			} else if (dc.GetCount () == GameConstants.PASSO6_TUTORIAL) {
				cursorArmario.enabled = false;
				mesaNeta.enabled = true;
				cursorMesaNeta.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_GELADEIRA);
				TestFlags (mesaNeta);
			} else if (dc.GetCount () == GameConstants.PASSO7_TUTORIAL) {
				cursorMesaNeta.enabled = false;
				fogao.enabled = true;
				cursorFogao.enabled = true;
				DefinirProximoDestino1 (GameConstants.VALOR_MESAVOVO);
				TestFlags (fogao);
			} else if (dc.GetCount () == GameConstants.PASSO8_TUTORIAL) {
				cursorFogao.enabled = false;
				mesaVovo.enabled = true;
				cursorMesaVo.enabled = true;
				DefinirProximoDestino1 (GameConstants.VALOR_MESAVOVO);
				TestFlags (mesaVovo);
			} else if (dc.GetCount () == GameConstants.PASSO9_TUTORIAL) {
				cursorMesaVo.enabled = false;
				geladeira.enabled = true;
				cursorGeladeira.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_MESANETA);
				TestFlags (geladeira);
			} else if (dc.GetCount () == GameConstants.PASSO10_TUTORIAL) {
				cursorGeladeira.enabled = false;
				mesaNeta.enabled = true;
				cursorMesaNeta.enabled = true;
				DefinirProximoDestino2 (GameConstants.VALOR_MESANETA);
				TestFlags (mesaNeta);
			} else if (dc.GetCount () == GameConstants.PASSO12_TUTORIAL) {
				cursorMesaNeta.enabled = false;
				geladeira.enabled = true;
				cursorGeladeira.enabled = true;
				TestFlags (geladeira);
			} else if (dc.GetCount () == GameConstants.PASSO36_TUTORIAL) {
				cursorGeladeira.enabled = false;
			}
		}
	}

	public void TestFlags (BoxCollider2D box)
	{
		if (SceneManager.GetActiveScene ().buildIndex == 2) {
			if (flagMover1) { 
				dc.SetCount ();
				btn.interactable = true;
				flagMover1 = false;	
				DeactivateObject (box);
			} else if (flagMover2) {
				dc.SetCount ();
				btn.interactable = true;
				flagMover2 = false;	
				DeactivateObject (box);
			}
		}
	}

	public void SetFlagMover1 ()
	{
		flagMover1 = true;
	}

	public void SetFlagMover2 ()
	{
		flagMover2 = true;
	}

	public void DeactivateObject (BoxCollider2D box)
	{
		box.enabled = false;
	}

	public void DefinirProximoDestino1 (int num1)
	{
		proximoBox1 = num1;
	}

	public void DefinirProximoDestino2 (int num2)
	{
		proximoBox2 = num2;
	}

	public int MandarPosicaoBox1 ()
	{
		return proximoBox1;
	}

	public int MandarPosicaoBox2 ()
	{
		return proximoBox2;
	}

	public void SetAllBoxesTrue ()
	{
		if (!flagBoxes) {
			forno.enabled = true;
			fogao.enabled = true;
			mesaVovo.enabled = true;
			armario.enabled = true;
			geladeira.enabled = true;
			mesaNeta.enabled = true;

			flagBoxes = true;
		}
	}

	public void SetBoxFalse (int num)
	{
		if (num == 0) {
			forno.enabled = false;
		} else if (num == 1) {
			fogao.enabled = false;
		} else if (num == 2) {
			mesaVovo.enabled = false;
		} else if (num == 3) {
			armario.enabled = false;
		} else if (num == 4) {
			geladeira.enabled = false;
		} else if (num == 5) {
			mesaNeta.enabled = false;
		}
	}
}