Exemplo n.º 1
0
    public virtual void Initiate(CardInfo_Base cardInfo, CardShowMode cardShowMode, ClientPlayer clientPlayer = null)
    {
        ClientPlayer = clientPlayer;
        CardInfo     = cardInfo.Clone();
        SetCardShowMode(cardShowMode);
        transform.rotation = Quaternion.Euler(0, 0, 0);
        transform.Rotate(Vector3.up, 180);
        Usable = false;
        if (DragComponent)
        {
            DragComponent.enabled = true;
        }
        BoxCollider.enabled = true;
        M_Metal             = CardInfo.BaseInfo.Metal;
        M_Energy            = CardInfo.BaseInfo.Energy;
        M_Coin = CardInfo.BaseInfo.Coin;
        string cur_Language = LanguageManager.Instance ? LanguageManager.Instance.GetCurrentLanguage() : "zh";

        M_Name = CardInfo.BaseInfo.CardNames[cur_Language] + (CardInfo.BaseInfo.IsTemp ? "*" : "");
        M_Desc = CardInfo.GetCardDescShow();

        CardDescComponent.SetTempCard(false);
        ChangeCardPicture(CardInfo.BaseInfo.PictureID);
        CardDescComponent?.SetCardTypeText(CardInfo.GetCardTypeDesc());
        SetBlockCountValue(0, true);
        SetBlockCountMaxValue(CardInfo.BaseInfo.LimitNum, true);
        SetBannerType(CardNoticeComponent.BannerTypes.None);
        SetArrowType(CardNoticeComponent.ArrowTypes.None);
        SetStarNumber(CardInfo.UpgradeInfo.CardLevel, CardInfo.UpgradeInfo.CardLevelMax);
        RefreshCardAllColors();
    }
Exemplo n.º 2
0
    protected override void InitializeComponents()
    {
        base.InitializeComponents();
        CardDescComponent.SetCardName(CardInfo.BaseInfo.CardNames[LanguageManager.Instance.GetCurrentLanguage()]);
        CardDescComponent.SetTempCard(false);
        CardBasicComponent.ChangePicture(CardInfo.BaseInfo.PictureID);
        CardSlotsComponent.SetSlot(ClientPlayer, this, CardInfo.MechInfo);
        CardSlotsComponent.ShowAllSlotBlooms(false);

        MechLifeComponent.Initialize(this);
        MechAttrShapesComponent.Initialize(this);
        MechBattleInfoComponent.Initialize(this);
        MechBloomComponent.Initialize(this);
        MechTargetPreviewArrowsComponent.Initialize(this);
        MechTriggerIconComponent.Initialize(this);
        MechSwordShieldArmorComponent.Initialize(this);
        MechEquipSystemComponent.Initialize(this);
    }