示例#1
0
    public void EnableNavigationBtns()
    {
        if (previousEntry != null)
        {
            PrevEntryButton.gameObject.SetActive(true);
        }

        if (nextEntry != null)
        {
            NextEntryButton.gameObject.SetActive(true);
        }

        Current = this;
    }
示例#2
0
    public void Setup(CollectionManager.Entry entry, CollectionUIEntry prevEntry, CollectionUIEntry nextEntry)
    {
        EntryName.text        = entry.Name;
        EntryDescription.text = entry.Description;
        EntryImage.sprite     = entry.Image;

        SetName(entry.HighScoreName);
        SetDepth(entry.HighScoreDepth);

        this.previousEntry = prevEntry;
        this.nextEntry     = nextEntry;

        DisableNavigationButtons();

        if (prevEntry != null)
        {
            PrevEntryButton.onClick.AddListener(() =>
            {
                DOTween.KillAll(transform.parent);
                transform.parent.DOLocalMoveX(-prevEntry.transform.localPosition.x, 0.5f).SetEase(Ease.OutQuad);
                DisableNavigationButtons();
                prevEntry.EnableNavigationBtns();
            });
        }
        else
        {
            PrevEntryButton.gameObject.SetActive(false);
        }

        if (nextEntry != null)
        {
            NextEntryButton.onClick.AddListener(() =>
            {
                DOTween.KillAll(transform.parent);
                transform.parent.DOLocalMoveX(-nextEntry.transform.localPosition.x, 0.5f).SetEase(Ease.OutQuad);
                DisableNavigationButtons();
                nextEntry.EnableNavigationBtns();
            });
        }
        else
        {
            NextEntryButton.gameObject.SetActive(false);
        }
    }