Esempio n. 1
0
    public void CreateTheme(int index)
    {
        themeView.SetActive(true);
        themesListView.SetActive(false);

        title.text = activThemes[index].Name;

        Analytics.CustomEvent("Pokrenuta Tema", new Dictionary <string, object>
        {
            { "Tema", activThemes[index].Label + " : " + activThemes[index].Name }
        });


        if (activThemes[index].Media != null)
        {
            if (activThemes[index].Media.Any <Media>(x => x.MediaTypeId == 3))
            {
                text.text = activThemes[index].Media.First <Media>(x => x.MediaTypeId == 3).Text;
            }


            if (activThemes[index].Media.Any <Media>(x => x.MediaTypeId == 4))
            {
                photos = activThemes[index].Media.First <Media>(x => x.MediaTypeId == 4).Photos.ToList <Photos>();

                //Debug.Log("CreateTheme  photos.Count: " + photos.Count);

                contentImageController.ImageSetup(photos);
            }
            else
            {
                contentImageController.HideImageHolders();
            }
        }
        else
        {
            contentImageController.HideImageHolders();
        }


        textScrollRect.verticalNormalizedPosition = 1;
    }
    // Update is called once per frame
    void Update()
    {
        if (startTimer)
        {
            closeTimer += Time.deltaTime;

            Debug.Log("closeTimer: " + closeTimer);

            if (closeTimer > 5)
            {
                Application.Quit();
            }
        }


        if (startDownloadTimer)
        {
            downloadTimer += Time.deltaTime;

            Debug.Log("downloadTimer: " + downloadTimer);

            if (downloadTimer > 5)
            {
                startDownloadTimer = false;
                downloadTimer      = 0;
                NewAppDownload();
            }
        }


        if (startResetTimer)
        {
            resetTimer += Time.deltaTime;

            //Debug.Log("resetTimer: " + resetTimer);

            if (resetTimer > (60 * 3))
            {
                contentController.ClearContent();
                menuController.ResetMenues();
                contentImageController.HideImageHolders();

                startResetTimer = false;
                resetTimer      = 0f;
            }
        }


        if (Input.GetMouseButtonDown(0))
        {
            resetTimer = 0f;
        }
    }