Ejemplo n.º 1
0
    void updateActivePage(GameObject obj)
    {
        //更新箭头
        int index = StringKit.toInt(obj.name) - 1;

        if (beastList.Count == 1)
        {
            leftArrow.gameObject.SetActive(false);
            rightArrow.gameObject.SetActive(false);
        }
        else if (index == 0)
        {
            leftArrow.gameObject.SetActive(false);
            rightArrow.gameObject.SetActive(true);
        }
        else if (index == beastList.Count - 1)
        {
            leftArrow.gameObject.SetActive(true);
            rightArrow.gameObject.SetActive(false);
        }
        else
        {
            leftArrow.gameObject.SetActive(true);
            rightArrow.gameObject.SetActive(true);
        }

        ActiveShowItem = obj.GetComponent <ButtonBeast> ();
        if (ActiveShowItem == null)
        {
            return;
        }
        updateBeast(ActiveShowItem.getBeastEvo());
        defaultIndex = StringKit.toInt(obj.name) - 1;
    }
Ejemplo n.º 2
0
    void updatePage(GameObject obj)
    {
        //更新当前显示的ShowItem;
        ActiveShowItem = sampleContent.getCenterObj().GetComponent <ButtonBeast> ();
        ButtonBeast bookitem = obj.GetComponent <ButtonBeast> ();
        int         index    = StringKit.toInt(obj.name) - 1;

        //不够3页.隐藏
        if (beastList == null || index >= beastList.Count || beastList [index] == null)
        {
            return;
        }
        //防止出现几个相同女神形象
        bookitem.updateBeast(beastList [index]);
    }