Ejemplo n.º 1
0
    private void OnSelectItem(FigureItem figureItem, InfoFigure info)
    {
        // AudioManager.PlaySound(AudioManager.selectFigureName);
        AudioManager1.Ins.PlaySound(SoundType.Click);

        if (currentFigureItem != previousFigureItem || figureItem != previousFigureItem)
        {
            previousFigureItem = currentFigureItem;
            currentFigureItem  = figureItem;

            previousFigureItem.SetActiveBox();
            currentFigureItem.SetActiveBox();

            currentInfoData = info;
        }

        if (!info.isBuy && info.mission != "")
        {
            missionInfo.GetComponentInChildren <Text>().text = info.mission;
            missionInfo.Show();
        }

        if (info.isBuy)
        {
            HideAllButton();
            listButton[0].Show();
        }
        else if (info.costType == CostType.Coin)
        {
            HideAllButton();
            costButtonTxt.text = info.cost.ToString();
            listButton[1].Show();
        }
        else if (info.costType == CostType.Video)
        {
            HideAllButton();
            videoTxt.text = figureItem.videoTxt.text;
            listButton[2].Show();
        }
        else
        {
            HideAllButton();
            // listButton[3].Show();
        }

        if (info.isUsing)
        {
            HideAllButton();
            // listButton[3].Show();
        }
    }
Ejemplo n.º 2
0
 public void ChangeCurrentFigure(int idFigure)
 {
     _currentFigure = idFigure;
     previousFigureItem.SetActiveBox();
     previousFigureItem = figureItems[idFigure - 30];
 }