// Use this for initialization
    void Start()
    {
        instance = this;

        HelperUtil.SetVisibility(gameObject, false);
        HelperUtil.SetVisibility(HelperUtil.FindGameObject(gameObject, "falseNewBaby"), false);
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        buttonPlay    = HelperUtil.FindGameObject(this.gameObject, "Jogar");
        buttonCredits = HelperUtil.FindGameObject(this.gameObject, "Creditos");
        buttonExit    = HelperUtil.FindGameObject(this.gameObject, "Sair");
        buttonOptions = HelperUtil.FindGameObject(this.gameObject, "Opcoes");

        buttonPlay.GetComponent <Button>().onClick.AddListener(delegate
        {
            Application.LoadLevel("new_Intro");
        });

        buttonCredits.GetComponent <Button>().onClick.AddListener(delegate
        {
            Application.LoadLevel("credits");
        });

        buttonExit.GetComponent <Button>().onClick.AddListener(delegate
        {
            Application.Quit();
        });

        buttonOptions.GetComponent <Button>().onClick.AddListener(delegate
        {
            NewMenu.GetInstance().ActivateMenu();
        });
    }
    public void Desactivate()
    {
        HelperUtil.SetVisibility(gameObject, false);
        HelperUtil.SetVisibility(HelperUtil.FindGameObject(gameObject, "falseNewBaby"), false);

        GetComponent <NavMeshAgent>().enabled = false;
    }
    // Use this for initialization
    void Start()
    {
        buttonBack = HelperUtil.FindGameObject(this.gameObject, "Voltar");

        buttonBack.GetComponent <Button>().onClick.AddListener(delegate
        {
            Application.LoadLevel("newMenu");
        });
    }
    // Update is called once per frame
    void Update()
    {
        light.intensity -= Time.deltaTime * 0.1f;
        fireParticle.GetComponent <ParticleSystem>().emissionRate -= Time.deltaTime * 0.1f;

        if (light.intensity < 0)
        {
            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundLareira").SetActive(false);
        }
    }
    public void Activate()
    {
        HelperUtil.SetVisibility(gameObject, true);
        HelperUtil.SetVisibility(HelperUtil.FindGameObject(gameObject, "falseNewBaby"), true);

        gameObject.transform.position             = new Vector3(269.02f, 4.449f, 237.2929f);
        GetComponent <NavMeshAgent>().enabled     = true;
        GetComponent <NavMeshAgent>().destination = GameObject.Find("AlvoBebe").transform.position;
        SetAnimationState(2);
    }
Пример #7
0
    private void ActivateCameraEventPicture()
    {
        //HelperUtil.SetVisibility(Player.GetInstance().gameObject, false);

        GameObject.Find("CameraLockCameraPicture1").GetComponent <Camera>().enabled = true;
        GameObject.Find("CameraLockCameraPicture1").GetComponent <Animator>().SetTrigger("activate");
        HelperUtil.FindGameObject(GameObject.Find("Audio"), "BackgroundMusic").SetActive(true);

        IncreaseVolumeBackgroundMusic();
        Invoke("PlayWomanEssaMolduraNaoENossa", 1.5f);
    }
Пример #8
0
    private void IncreaseSoundPersecution()
    {
        GameObject  audioGO = HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundPersecution");
        AudioSource audio   = audioGO.GetComponent <AudioSource>();

        audio.volume += 0.01f;

        if (audio.volume < 0.99)
        {
            Invoke("IncreaseSoundPersecution", 0.20f);
        }
    }
Пример #9
0
    private void DecreaseVolumeSoundViolin()
    {
        GameObject  audioGO = HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundViolin");
        AudioSource audio   = audioGO.GetComponent <AudioSource>();

        audio.volume -= 0.1f;

        if (audio.volume > 0.01)
        {
            Invoke("DecreaseVolumeSoundViolin", 0.20f);
        }
    }
Пример #10
0
    private void IncreaseVolumeBackgroundMusic()
    {
        GameObject  audioGO = HelperUtil.FindGameObject(GameObject.Find("Audio"), "BackgroundMusic");
        AudioSource audio   = audioGO.GetComponent <AudioSource>();

        audio.volume += 0.01f;

        if (audio.volume < 0.1)
        {
            Invoke("IncreaseVolumeBackgroundMusic", 0.20f);
        }
    }
Пример #11
0
    private void InitialEvent()
    {
        Player.GetInstance().Actions.Add(Constants.ActionGetFlashLight);

        GameObject lightsFather = GameObject.Find("Desativaveis");

        Light[] lights = lightsFather.transform.GetComponentsInChildren <Light>();

        foreach (Light light in lights)
        {
            light.range = 0;
        }

        HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundLightOff").SetActive(true);
    }
    public void Interact()
    {
        string[] partsPicture = new string[] {
            Constants.PictureP1Item,
            Constants.PictureP2Item,
            Constants.PictureP3Item,
            Constants.PictureP4Item
        };

        clickCounter += 1;

        if (hasCompletedPicture)
        {
            EventManager.GetInstance().SetEvent("babyPersecution");
            PartsToCompletePicture(partsPicture);
            SubtitleManager.GetInstance().SetText(pictureComplete);
            gameObject.SetActive(false);
        }

        if (clickCounter > 2)
        {
            AudioRepository audioRepo = AudioRepository.GetInstance();

            if (!audioRepo.gameObject.GetComponent <AudioSource>().isPlaying)
            {
                audioRepo.gameObject.GetComponent <AudioSource>().clip = audioRepo.incompletePictureAudio;
                audioRepo.gameObject.GetComponent <AudioSource>().Play();
            }
        }

        Invoke("ResetCounter", 30f);

        AddPartsPicture(partsPicture);

        if (pictureCounter > 0)
        {
            SubtitleManager.GetInstance().SetText(pictureIncomplete);
        }
        else
        {
            hasCompletedPicture = true;
            HelperUtil.FindGameObject(GameObject.Find("Sangue pós quarta foto"), "SangueContainer").SetActive(true);
        }
    }
Пример #13
0
    public void SetEvent(string eventName)
    {
        switch (eventName)
        {
        case "pegueOCelular":
            SubtitleManager.GetInstance().SetText("Pegue o celular");
            break;

        case "espacoParaInteragir":
            SubtitleManager.GetInstance().SetText("Pressione [ESPAÇO] para interagir");
            break;

        case "desactivateAllCameras":
            DesactivateAllCameras();
            break;

        case "shakeDoors":
            ShakeDoors();
            break;

        case "lockDoors":
            LockDoors();

            break;

        case "activateIconFlashLight":
            ActivateIconFlash();
            break;

        case "activateIconSmartPhone":
            GameObject.Find("tutorial").SetActive(false);
            GameObject.Find("tutorial2").SetActive(false);
            ActivateIconSmartPhone();
            break;

        case "initialEvent":

            Invoke("InitialEvent", 3);
            Invoke("ActivateIconFlash", 3);
            Invoke("BabyCry", 5);
            Invoke("ActivateBaby", 6);

            //Monster.GetInstance().currActionState = Monster.MonsterActionState.Rest;

            break;

        case "lockCameraPicture1":
            Player.GetInstance().GetComponent <FirstPersonController>().enabled = false;
            Main.GetInstance().inCutScene = true;

            FadeInScreen();
            Invoke("ActivateCameraEventPicture", 1.2f);
            Invoke("FadeOutScreen", 1.8f);

            Invoke("FadeInScreen", 4.8f);
            Invoke("FadeOutScreen", 5.5f);
            Invoke("DesactivateCameraEventPicture", 5.5f);

            break;

        case "activatePart2":
            ShakeDoors();
            ActivatePartPicture(Constants.PictureP2Item);

            HelperUtil.FindGameObject(GameObject.Find("Eventos"), "Item2").SetActive(true);
            break;

        case "activateAnimPart2":

            //HelperUtil.FindGameObject(GameObject.Find("Quadros de Enfeite"), "Q01").GetComponent<Animator>().SetTrigger("activate");
            HelperUtil.FindGameObject(GameObject.Find("Quadros de Enfeite"), "Q01").GetComponent <Rigidbody>().constraints = RigidbodyConstraints.None;
            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundQuadroCaindo").SetActive(true);;
            break;

        case "activatePart3":
            Player.GetInstance().GetComponent <FirstPersonController>().enabled = false;
            Main.GetInstance().inCutScene = true;

            Monster.GetInstance().CancelAttack();
            Monster.GetInstance().currActionState = Monster.MonsterActionState.Rest;
            Monster.GetInstance().SetVisibility(false);

            FalseMonster.GetInstance().Activate();

            //Monster.GetInstance ().mosterNV.enabled = true;
            //Monster.SetAnimationState (Monster.MonsterAnimation.Crawl);
            //Monster.GetInstance().gameObject.transform.position = new Vector3(269.02f, 4.449f, 237.2929f);
            //Monster.GetInstance().gameObject.transform.position = new Vector3(270.67f, 4.449f, 237.2929f);
            //Monster.GetInstance().mosterNV.destination = GameObject.Find("AlvoBebe").transform.position;

            ActivatePartPicture(Constants.PictureP3Item);
            GameObject.Find("PortaChave").GetComponent <DoorWrapper>().typeAnim = DoorWrapper.DoorAnim.Locked;

            FadeInScreen();
            Invoke("ActivateCameraOpenRoom", 1.2f);
            Invoke("FadeOutScreen", 2);

            Invoke("OpenClosedRoom", 1.4f);

            Invoke("FadeInScreen", 4.8f);
            Invoke("FadeOutScreen", 5.5f);
            Invoke("DesactivateCameraOpenRoom", 5.5f);

            //FadeInScreen();

            break;

        case "activatePart4":

            ActivatePartPicture(Constants.PictureP4Item);
            GameObject.Find("PortaEscritorio").GetComponent <DoorWrapper>().typeAnim = DoorWrapper.DoorAnim.Locked;

            break;

        case "audioVidroArranhado":
            Invoke("ActivateSoundVidroArranhado", 0.6f);
            break;

        case "babyPersecution":

            //Monster.GetInstance().currActionState = Monster.MonsterActionState.Rest;
            Monster.GetInstance().PersecutionMode();
            Monster.GetInstanceAudioSource().GetComponent <AudioSource>().Pause();
            Monster.SetAnimationState(Monster.MonsterAnimation.Crawl);
            Player.GetMotionBlur().blurAmount = 0.6f;
            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundPersecution").SetActive(true);
            IncreaseSoundPersecution();


            break;

        case "babyRest":


            Player.GetInstance().GetComponent <FirstPersonController>().enabled = false;
            Main.GetInstance().inCutScene = true;

            //Player.GetInstance().GetComponent<FirstPersonController>().ChangeMouseSensitivity(0, 0);

            Monster.GetInstance().CancelAttack();
            Monster.GetInstance().currActionState = Monster.MonsterActionState.Rest;

            GameObject.Find("portaFinal").GetComponent <Animator>().SetTrigger("open2");

            HelperUtil.FindGameObject(GameObject.Find("Iluminação"), "spotPortaBebe").SetActive(true);
            HelperUtil.FindGameObject(GameObject.Find("Iluminação"), "luzParte3").GetComponentInChildren <Light>().range = 4;

            FadeInScreen();
            Invoke("FadeOutScreen", 1.8f);

            Invoke("ActivateCameraRoomBaby", 1.4f);

            Invoke("FadeInScreen", 4.8f);
            Invoke("FadeOutScreen", 5.5f);

            Invoke("DesactivateCameraRoomBaby", 5.5f);

            break;

        case "gameOver":
            Player.GetInstance().GetComponent <FirstPersonController>().enabled = false;
            Main.GetInstance().inCutScene = true;

            FadeInScreen();
            Invoke("FadeOutScreen", 1.8f);

            Invoke("ActivateSoundBaby", 2);

            Invoke("ActivateCameraGameOver", 1.4f);

            Invoke("FadeInScreen", 4.8f);
            Invoke("ActivateSoundWoman", 7.2f);

            Invoke("FadeInGameOver", 10);
            //Invoke("FadeOutScreen", 5.5f);

            break;
        }
    }
Пример #14
0
 private void ActivateSoundVidroArranhado()
 {
     HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundVidroArranhado").SetActive(true);
 }
Пример #15
0
 private void PlayWomanEssaMolduraNaoENossa()
 {
     HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundEssaMolduraNaoÉNossa").SetActive(true);
 }
Пример #16
0
    private void PlaySoundViolin2()
    {
        HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundViolin2").SetActive(true);

        //Invoke("DecreaseVolumeSoundViolin", 2);
    }
Пример #17
0
    public void Interact()
    {
        if (Main.GetInstance().inCutScene)
        {
            Debug.Log("ativou cutscene");
            DesactivateAnimHand();
            return;
        }

        rayToInteract = Player.GetCamera().ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));

        if (Physics.Raycast(rayToInteract, out hitInfo, rangeInteract))
        {
            switch (hitInfo.collider.tag)
            {
            case "InteractItem":
                ActivateAnimHand();
                GetInteractItem(hitInfo);
                break;

            case "Item":
                if (IsActiveItem(hitInfo))
                {
                    //if (hitInfo.collider.gameObject.name.Contains ("celular")) {
                    //    SubtitleManager.GetInstance ().SetText ("[ESPACO] para interagir");
                    //}

                    ActivateAnimHand();
                    GetItem(hitInfo);
                }
                break;

            case "Door":
                ActivateAnimHand();
                OpenDoor(hitInfo);
                break;

            case "Fireplace":
                ActivateAnimHand();
                Fireplace firePlace = hitInfo.transform.gameObject.GetComponent <Fireplace>();

                if (Input.GetKeyDown(KeyCode.Space))
                {
                    if (Player.GetInstance().Items.Contains(Constants.PictureItem))
                    {
                        if (Player.GetInstance().items.Contains(Constants.StockWood))
                        {
                            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundLareira").SetActive(true);
                            Player.GetInstance().items.Remove(Constants.StockWood);
                            firePlace.light.intensity = firePlace.lightIntensity;
                            firePlace.fireParticle.GetComponent <ParticleSystem>().emissionRate = 6;
                            //firePlace.fireParticle.GetComponent<ParticleSystem>().emissionRate = 3;
                            //firePlace.fireParticle.GetComponent<ParticleSystem>().Play();
                            //firePlace.fireParticle.GetComponent<ParticleSystem>().enableEmission = true;
                        }

                        if (hasDestroyedPicture || firePlace.light.intensity > firePlace.minlightIntensity)
                        {
                            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundPersecution").SetActive(false);
                            EventManager.GetInstance().SetEvent("babyRest");
                            hasDestroyedPicture = true;
                        }
                        else
                        {
                            if (firePlace.light.intensity < firePlace.minlightIntensity)
                            {
                                SubtitleManager.GetInstance().SetText("Recarregue a lareira para queimar o quadro.");
                            }
                            else
                            {
                                SubtitleManager.GetInstance().SetText("Recarregou a lareira. Destrua o quadro");
                                hasDestroyedPicture = true;
                            }
                        }
                    }
                    else
                    {
                        if (Player.GetInstance().items.Contains(Constants.StockWood))
                        {
                            HelperUtil.FindGameObject(GameObject.Find("Audio"), "SoundLareira").SetActive(true);
                            firePlace.light.intensity = firePlace.lightIntensity;
                            firePlace.fireParticle.GetComponent <ParticleSystem>().emissionRate = 6;
                            Debug.Log(firePlace.light.intensity);
                            Player.GetInstance().items.Remove(Constants.StockWood);
                            SubtitleManager.GetInstance().SetText("Recarregou a lareira.");
                        }
                        else
                        {
                            SubtitleManager.GetInstance().SetText("Pegue lenha");
                        }
                    }
                }

                Debug.Log("Lareira");
                break;

            default:
                DesactivateAnimHand();
                break;
            }
        }
        else
        {
            DesactivateAnimHand();
        }
    }
    void BindMenu()
    {
        inventoryMenu = GameObject.Find("MenuInventario");

        configMenu         = GameObject.Find("MenuConfiguracoes");
        transitionBgConfig = GameObject.Find("EfeitoTransicao");

        buttonConfigMenu = HelperUtil.FindGameObject(smartphone, "BotaoConfiguracoes");
        //buttonConfigMenu.GetComponent<Button>().onClick.AddListener(EnterConfig);

        buttonItemsMenu = HelperUtil.FindGameObject(smartphone, "BotaoItens");
        buttonConfigMenu.GetComponent <Button>().onClick.AddListener(EnterInventory);

        buttonExitMenu = HelperUtil.FindGameObject(smartphone, "BotaoSair");
        buttonExitMenu.GetComponent <Button>().onClick.AddListener(EnterExit);

        exitMenu        = HelperUtil.FindGameObject(smartphone, "FundoPadraoSair");
        exitLoadingMenu = HelperUtil.FindGameObject(smartphone, "AnimacaoSair");

        GameObject itemInventory = HelperUtil.FindGameObject(smartphone, "ItemInventario");

        inventoryItemTemplate  = itemInventory;
        inventoryItemPhone     = itemInventory;
        inventoryItemPicture   = HelperUtil.FindGameObject(smartphone, "ItemQuadroCompleto");
        inventoryItemPictureP1 = HelperUtil.FindGameObject(smartphone, "ItemFoto1");
        inventoryItemPictureP2 = HelperUtil.FindGameObject(smartphone, "ItemFoto2");
        inventoryItemPictureP3 = HelperUtil.FindGameObject(smartphone, "ItemFoto3");
        inventoryItemPictureP4 = HelperUtil.FindGameObject(smartphone, "ItemFoto4");
        inventoryItemStockWood = HelperUtil.FindGameObject(smartphone, "ItemTora");
        inventoryItemKey       = HelperUtil.FindGameObject(smartphone, "ItemChave");

        buttonResolution = GameObject.Find("BotaoJanela");
        textResolution   = buttonResolution.GetComponentInChildren <Text>();

        textResolution.text = fullScreenMode;

        if (!Screen.fullScreen)
        {
            textResolution.text = windowedMode;
        }

        buttonResolution.GetComponent <Button>().onClick.AddListener(delegate
        {
            ChangeScreenSize();
        }
                                                                     );

        sliderSensivity = HelperUtil.FindGameObject(smartphone, "SliderSensibilidade");

        sliderSensivity.GetComponent <Slider>().onValueChanged.AddListener(delegate
        {
            OnChangeSensivity();
        });

        sliderSound = HelperUtil.FindGameObject(smartphone, "SliderMusica");

        sliderSound.GetComponent <Slider>().onValueChanged.AddListener(delegate
        {
            AudioListener.volume   = sliderSound.GetComponent <Slider>().value;
            GameInfo.volumeEffects = sliderSound.GetComponent <Slider>().value;

            PlayerPrefs.SetFloat("volumeEffects", sliderSound.GetComponent <Slider>().value);
            PlayerPrefs.Save();

            Debug.Log(PlayerPrefs.GetFloat("volumeEffects"));
        });


        dropDownResolucoes = HelperUtil.FindGameObject(smartphone, "DropdownResolucoes");
        Dropdown dropDownResolucoesAsDropDown = dropDownResolucoes.GetComponent <Dropdown>();

        Resolution[] resolutions = Screen.resolutions;

        foreach (Resolution res in resolutions)
        {
            if (res.height >= 960)
            {
                Dropdown.OptionData currRes = new Dropdown.OptionData();
                currRes.text = res.width + "x" + res.height;

                dropDownResolucoesAsDropDown.options.Add(currRes);

                if (res.width == Screen.width && res.height == Screen.height)
                {
                    dropDownResolucoes.GetComponent <Dropdown>().value = dropDownResolucoes.GetComponent <Dropdown>().options.Count - 1;
                }
            }
        }

        if (dropDownResolucoesAsDropDown.options.Count > 0)
        {
            dropDownResolucoesAsDropDown.captionText.text = dropDownResolucoesAsDropDown.options[dropDownResolucoes.GetComponent <Dropdown>().value].text;

            dropDownResolucoesAsDropDown.onValueChanged.AddListener(delegate
            {
                string[] resolucao = dropDownResolucoesAsDropDown.options[dropDownResolucoesAsDropDown.value].text.Split('x');

                int width  = int.Parse(resolucao[0]);
                int height = int.Parse(resolucao[1]);

                Screen.SetResolution(width, height, Screen.fullScreen);
            });
        }
        else
        {
            Debug.Log("Mudança de resolução não disponível dentro do Editor da Unity");
        }


        dropDownQualidade = HelperUtil.FindGameObject(smartphone, "DropdownQualidade");
        Dropdown dropDownQualidadeAsDropDown = dropDownQualidade.GetComponent <Dropdown>();

        string[] qualitysTranslated = new string[] { "Muito baixa", "Baixa", "Normal", "Alta", "Muito Alta" };

        for (int i = 0; i < qualitysTranslated.Length; i++)
        {
            Dropdown.OptionData currRes = new Dropdown.OptionData();
            currRes.text = qualitysTranslated[i];

            dropDownQualidadeAsDropDown.options.Add(currRes);
        }

        dropDownQualidadeAsDropDown.captionText.text = dropDownQualidadeAsDropDown.options[0].text;

        dropDownQualidadeAsDropDown.onValueChanged.AddListener(delegate
        {
            QualitySettings.SetQualityLevel(dropDownQualidadeAsDropDown.value);
        });

        sliderSensivity = HelperUtil.FindGameObject(smartphone, "SliderSensibilidade");
        Slider sliderSensivityAsSlider = sliderSensivity.GetComponent <Slider>();

        sliderSensivityAsSlider.onValueChanged.AddListener(delegate
        {
            OnChangeSensivity();
        });

        buttonExitYes      = HelperUtil.FindGameObject(smartphone, "BotaoSairSim");
        buttonExitNo       = HelperUtil.FindGameObject(smartphone, "BotaoSairNao");
        textConfirmExit    = HelperUtil.FindGameObject(smartphone, "TextoSair");
        contentConfirmExit = HelperUtil.FindGameObject(smartphone, "Confirm");

        buttonExitYes.GetComponent <Button>().onClick.AddListener(delegate
        {
            InvokeRepeating("GoingOutExitConfirm", 0, tickAnim);
            Invoke("GoingInRealExit", 0.8f);
            Invoke("ExitGame", 1);
        });

        buttonExitNo.GetComponent <Button>().onClick.AddListener(delegate
        {
            if (!inAnimation)
            {
                InvokeRepeating("GoingOutExit", 0, tickAnim);
                InvokeRepeating("GoingInMenu", 0.8f, 0.1f);
            }
        });

        if (context == MenuContext.InGame)
        {
            tutorialMenu = HelperUtil.FindGameObject(smartphone, "Tutorial");
            tutorialMenu.SetActive(true);
            buttonTutorial = HelperUtil.FindGameObject(smartphone, "BotaoFecharTutorial");

            buttonTutorial.GetComponent <Button>().onClick.AddListener(delegate
            {
                InvokeRepeating("GoingOutTutorial", 0, 0.1f);
                //InvokeRepeating("GoingOutExit", 0, 0.1f);
                //tutorialMenu.SetActive(false);
            });
        }
    }
    void FillInventory()
    {
        List <string> items = new List <string>();

        if (context == MenuContext.Menu)
        {
            items = new List <string> {
                Constants.PhoneItem,
                Constants.Key,
                Constants.StockWood,
                Constants.PictureItem,
                Constants.PictureP1Item,
                Constants.PictureP2Item,
                Constants.PictureP3Item,
                Constants.PictureP4Item
            };
        }
        else
        {
            items = Player.GetInstance().Items;
        }



        Vector2 originalPos = new Vector2(-238, 285);
        Vector2 initialPos  = new Vector2(0, 0);

        //Vector2 originalPos = new Vector2(-100, 160);
        //Vector2 initialPos = new Vector2(-100, 160);

        int incrementY = 0;
        int counter    = 0;


        for (int i = 0; i < items.Count; i++)
        {
            GameObject currItem = null;

            //if (items[i] == Constants.PhoneItem)
            //{
            //    return;
            //}

            Debug.Log(items[i]);

            switch (items[i])
            {
            case Constants.PhoneItem:
                currItem = (GameObject)Instantiate(inventoryItemPhone, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.Key:
                currItem = (GameObject)Instantiate(inventoryItemKey, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.StockWood:
                currItem = (GameObject)Instantiate(inventoryItemStockWood, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.PictureItem:
                currItem = (GameObject)Instantiate(inventoryItemPicture, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.PictureP1Item:
                currItem = (GameObject)Instantiate(inventoryItemPictureP1, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.PictureP2Item:
                currItem = (GameObject)Instantiate(inventoryItemPictureP2, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.PictureP3Item:
                currItem = (GameObject)Instantiate(inventoryItemPictureP3, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            case Constants.PictureP4Item:
                currItem = (GameObject)Instantiate(inventoryItemPictureP4, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;

            default:
                currItem = (GameObject)Instantiate(inventoryItemTemplate, firstMenu.transform.position, new Quaternion(0, 0, 0, 0));
                break;
            }

            if (items[i] != Constants.PhoneItem && !String.IsNullOrEmpty(items[i]))
            {
                if (counter % 3 == 0)
                {
                    initialPos    = new Vector2(originalPos.x, originalPos.y);
                    incrementY   -= 140;
                    initialPos.y += incrementY;
                }

                initialPos = new Vector2(initialPos.x + 120, initialPos.y);

                CanvasGroup cg = currItem.GetComponent <CanvasGroup>();

                //currItem.GetComponentInChildren<Text>().text = items[i];
                //currItem.GetComponentInChildren<Text>().text = "";

                currItem.transform.SetParent(firstMenu.transform, false);
                currItem.GetComponent <RectTransform>().transform.localPosition = new Vector3(initialPos.x, initialPos.y);
                currItem.SetActive(true);
                cg.alpha = 0;

                counter += 1;
            }

            GameObject bgTitleInventory = HelperUtil.FindGameObject(smartphone, "FundoTextoInventario");
            GameObject titleInventory   = HelperUtil.FindGameObject(smartphone, "TextoInventario");

            bgTitleInventory.SetActive(true);
            titleInventory.SetActive(true);

            //itemsInventory = GameObject.FindGameObjectsWithTag("ItemInventory").ToList();


            //itemsInventory.Add (bgTitleInventory);
            //itemsInventory.Add (titleInventory);
        }

        itemsInventory = GameObject.FindGameObjectsWithTag("ItemInventory").ToList();
    }