Пример #1
0
    private void OnExhibitVisited(ExhibitTag exhibitTag)
    {
        for (int i = 0; i < ExhibitButtons.Length; i++)
        {
            ExhibitButton exhibitButton = ExhibitButtons[i];

            if (exhibitButton.ExhibitTag == exhibitTag)
            {
                Image iconImage      = exhibitButton.transform.GetChild(0).GetComponent <Image>();
                Color temporaryColor = iconImage.color;
                temporaryColor.a             = 1f;
                iconImage.color              = temporaryColor;
                exhibitButton.gameObject.tag = "Visited";
            }
        }
    }
Пример #2
0
    //Button OnClick event
    public void PreviousPage()
    {
        int numberOfPreviousPage = pageNumber - 1;

        if (numberOfPreviousPage >= 0)
        {
            pageNumber--;

            for (int i = 0; i < exhibitButtonManager.ExhibitButtons.Length; i++)
            {
                if ((int)exhibitButtonManager.ExhibitButtons[i].ExhibitTag == pageNumber)
                {
                    ExhibitButton exhibitButton = exhibitButtonManager.ExhibitButtons[i];
                    PopulateJournalInfo(exhibitButton);
                }
            }
        }
    }
Пример #3
0
    //Button OnClick event
    public void NextPage()
    {
        int numberOfNextPage = pageNumber + 1;

        if (numberOfNextPage < exhibitButtonManager.ExhibitButtons.Length)
        {
            pageNumber++;

            for (int i = 0; i < exhibitButtonManager.ExhibitButtons.Length; i++)
            {
                if ((int)exhibitButtonManager.ExhibitButtons[i].ExhibitTag == pageNumber)
                {
                    ExhibitButton exhibitButton = exhibitButtonManager.ExhibitButtons[i];
                    PopulateJournalInfo(exhibitButton);
                }
            }
        }
    }
Пример #4
0
    private void PopulateJournalInfo(ExhibitButton exhibitButton)
    {
        exhibitTitle.text   = exhibitButton.Title;
        exhibitImage.sprite = exhibitButton.ExhibitImage;

        if (exhibitButton.gameObject.tag == "Visited")
        {
            exhibitText.text = exhibitButton.ExhibitText;
        }
        else
        {
            exhibitText.text = defaultExhibitText;
        }

        if (!journalCanvas.gameObject.activeInHierarchy)
        {
            journalCanvas.gameObject.SetActive(true);
        }
    }
Пример #5
0
    //Button OnClick event
    public void OpenJournal(ExhibitButton exhibitButton)
    {
        pageNumber = (int)exhibitButton.ExhibitTag;

        PopulateJournalInfo(exhibitButton);
    }