コード例 #1
0
ファイル: CardUI.cs プロジェクト: ArtReeX/memoria
    private void Awake()
    {
        base.FadingComponent           = this.ScreenFadeGameObject.GetComponent <HonoFading>();
        this.levelLabel                = this.PlayerInfoPanel.GetChild(0).GetChild(0).GetChild(3).GetComponent <UILabel>();
        this.classNameLabel            = this.PlayerInfoPanel.GetChild(0).GetChild(1).GetComponent <UILabel>();
        this.winCountLabel             = this.PlayerInfoPanel.GetChild(1).GetChild(0).GetChild(2).GetComponent <UILabel>();
        this.loseCountLabel            = this.PlayerInfoPanel.GetChild(1).GetChild(1).GetChild(2).GetComponent <UILabel>();
        this.drawCountLabel            = this.PlayerInfoPanel.GetChild(1).GetChild(2).GetChild(2).GetComponent <UILabel>();
        this.stockCountLabel           = this.CardSelectionListPanel.GetChild(1).GetChild(1).GetComponent <UILabel>();
        this.typeCountLabel            = this.CardSelectionListPanel.GetChild(1).GetChild(3).GetComponent <UILabel>();
        this.cardInfoContentGameObject = this.CardInfoPanel.GetChild(0);
        this.cardNumberGameObject      = this.CardInfoPanel.GetChild(0).GetChild(1);
        this.currentCardNumberLabel    = this.CardInfoPanel.GetChild(0).GetChild(1).GetChild(1).GetComponent <UILabel>();
        this.totalCardNumberLabel      = this.CardInfoPanel.GetChild(0).GetChild(1).GetChild(3).GetComponent <UILabel>();
        this.cardNameLabel             = this.CardInfoPanel.GetChild(0).GetChild(2).GetChild(1).GetComponent <UILabel>();
        this.prevOffsetButton          = this.CardInfoPanel.GetChild(0).GetChild(1).GetChild(0).GetComponent <BoxCollider>();
        this.nextOffsetButton          = this.CardInfoPanel.GetChild(0).GetChild(1).GetChild(4).GetComponent <BoxCollider>();
        Int32 num = 0;

        foreach (Object obj in this.CardSelectionListPanel.transform.GetChild(0))
        {
            Transform transform = (Transform)obj;
            Int32     num2      = num % 10 * 10;
            num2 += num / 10;
            num++;
            CardUI.CardListHUD cardListHUD = new CardUI.CardListHUD(transform.gameObject, num2);
            this.cardHudList.Add(cardListHUD);
            cardListHUD.CardHighlightAnimation.enabled = false;
            UIEventListener uieventListener = UIEventListener.Get(cardListHUD.Self);
            uieventListener.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(uieventListener.onClick, new UIEventListener.VoidDelegate(this.onClick));
        }
        foreach (Object obj2 in this.CardInfoPanel.GetChild(0).GetChild(0).transform)
        {
            Transform     transform2 = (Transform)obj2;
            CardDetailHUD item       = new CardDetailHUD(transform2.gameObject);
            this.cardDetailHudList.Add(item);
        }
        UIEventListener uieventListener2 = UIEventListener.Get(this.DeleteSubmenuButton);

        uieventListener2.Click += onClick;

        _uiDiscardDialog = new UiDiscardDialog(DeleteDialogGameObject);
        _uiDiscardDialog.Content.Confirm.UiEventListener.onClick += onClick;
        _uiDiscardDialog.Content.Cancel.UiEventListener.onClick  += onClick;

        if (_uiDiscardDialog.Content.Auto != null)
        {
            _uiDiscardDialog.Content.Auto.UiEventListener.onClick += onClick;
        }

        this.cardDetailTransition   = this.TransitionPanel.GetChild(0).GetComponent <HonoTweenPosition>();
        this.deleteDialogTransition = this.TransitionPanel.GetChild(1).GetComponent <HonoTweenClipping>();
        UILabel component = this.PlayerInfoPanel.GetChild(0).GetChild(0).GetChild(0).GetComponent <UILabel>();

        component.SetAnchor((Transform)null);
        component.width  = 332;
        component.height = 40;
    }
コード例 #2
0
ファイル: CardUI.cs プロジェクト: ArtReeX/memoria
 public override Boolean OnItemSelect(GameObject go)
 {
     if (base.OnItemSelect(go) && ButtonGroupState.ActiveGroup == CardUI.CardGroupButton)
     {
         CardUI.CardListHUD cardListHUD  = this.cardHudList[go.transform.GetSiblingIndex()];
         CardUI.CardListHUD cardListHUD2 = (this.currentCardId == -1) ? null : this.cardHudList[this.currentCardId];
         Int32 id = cardListHUD.Id;
         if (this.currentCardId != id)
         {
             this.currentCardId = id;
             this.DisplayCardDetail();
             cardListHUD.CardHighlightAnimation.enabled = true;
             if (cardListHUD2 != null || cardListHUD.Id == cardListHUD2.Id)
             {
                 cardListHUD2.CardHighlightAnimation.enabled = false;
             }
         }
     }
     return(true);
 }
コード例 #3
0
ファイル: CardUI.cs プロジェクト: ArtReeX/memoria
    private void DisplayCardList()
    {
        Int32 id;

        for (id = 0; id < 100; id++)
        {
            Byte b = this.count[id];
            CardUI.CardListHUD cardListHUD = this.cardHudList.First((CardUI.CardListHUD hud) => hud.Id == id);
            if (b > 0)
            {
                CardIcon.Attribute attribute  = QuadMistDatabase.MiniGame_GetCardAttribute(id);
                String             spriteName = String.Concat(new Object[]
                {
                    "card_type",
                    (Int32)attribute,
                    "_",
                    (b <= 1) ? "normal" : "select"
                });
                cardListHUD.CardIconSprite.spriteName = spriteName;
                if (b > 1)
                {
                    cardListHUD.CardAmountLabel.gameObject.SetActive(true);
                    cardListHUD.CardAmountLabel.text = b.ToString();
                }
                else
                {
                    cardListHUD.CardAmountLabel.gameObject.SetActive(false);
                }
            }
            else
            {
                cardListHUD.CardAmountLabel.gameObject.SetActive(false);
                cardListHUD.CardIconSprite.spriteName = "card_slot";
            }
        }
        this.stockCountLabel.text = QuadMistDatabase.MiniGame_GetAllCardCount().ToString();
        this.typeCountLabel.text  = QuadMistDatabase.MiniGame_GetCardKindCount().ToString();
    }