public void updateButton(Card newCard)
    {
        if (newCard == null)
        {
            cleanBtton();
            return;
        }
        else
        {
            resetCard();
            card = newCard;
            showStar(card);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), cardImage);
            quality.gameObject.SetActive(true);
            quality.spriteName  = QualityManagerment.qualityIconBgToBackGround(card.getQualityId());
            spriteBg.spriteName = QualityManagerment.qualityIDToBackGround(card.getQualityId());
            qualitytext.gameObject.SetActive(true);
            qualitytext.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.getJob());
            inTeamSprite.gameObject.SetActive(card.isInTeam());
            bian.gameObject.SetActive(true);
            bian.spriteName = QualityManagerment.qualityBianToBackGround(card.getQualityId());
            level.text      = "Lv." + card.getLevel();
            showEvoLevel();

            //标识是否出战
            if (state != null)
            {
                if (ArmyManager.Instance.getAllArmyPlayersIds().Contains(card.uid) || ArmyManager.Instance.getAllArmyAlternateIds().Contains(card.uid))
                {
                    state.gameObject.SetActive(true);
                }
                else
                {
                    state.gameObject.SetActive(false);
                }
            }

            //如果是主卡,打标识
            if (IntensifyCardManager.Instance.compareMainCard(card) && (fatherWindow as IntensifyCardChooseWindow).getSelectType() == IntensifyCardManager.MAINCARDSELECT)
            {
                setShower(true);
                isChoose = true;
                return;
            }
            if (IntensifyCardManager.Instance.isInFood(card) && (fatherWindow as IntensifyCardChooseWindow).getSelectType() == IntensifyCardManager.FOODCARDSELECT)
            {
                if (isCanSelect())
                {
                    setShower(true);
                    isChoose = true;
                }
                return;
            }
        }
    }
Beispiel #2
0
    public void updateButton(PvpOppTeam info)
    {
        card = null;
        CardSample cs = CardSampleManager.Instance.getRoleSampleBySid(info.sid);

        level.text = "Lv." + EXPSampleManager.Instance.getLevel(cs.levelId, info.exp, 0).ToString();

        card = CardManagerment.Instance.createCard(info.sid, info.evoLevel, info.surLevel);
        image.gameObject.SetActive(true);
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), image);
        int qualityid = card.getQualityId();

        spriteBgQuality.spriteName = QualityManagerment.qualityIDToBackGround(qualityid);

        jobSprite.spriteName     = QualityManagerment.qualityIconBgToBackGround(card.getQualityId());
        jobTextSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.getJob());
        jobBian.spriteName       = QualityManagerment.qualityBianToBackGround(card.getQualityId());

        this.setNormalSprite(QualityManagerment.qualityIDToBackGround(qualityid));

        updateEvoLv();
    }
Beispiel #3
0
    public void updateInfo()
    {
        if (card != null)
        {
            if (inbattle != null)
            {
                inbattle.gameObject.SetActive(!hideInBattle && (ArmyManager.Instance.getAllArmyPlayersIds().Contains(card.uid) || ArmyManager.Instance.getAllArmyAlternateIds().Contains(card.uid)));
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), icon);
            if (deathMask != null)
            {
                if (isdeath)
                {
                    deathMask.gameObject.SetActive(true);
                    deathMask.gameObject.transform.localScale = new Vector3(1.4f, 1.4f, 1);
//					icon.color = Color.blue;
                }
                else
                {
                    deathMask.gameObject.SetActive(false);
//					icon.color = Color.white;
                }
            }
            if (quality != null)
            {
                quality.spriteName = QualityManagerment.qualityIDToString(card.getQualityId());
            }
            if (quality != null)
            {
                quality.gameObject.SetActive(true);
            }
            if (qualityBg != null)
            {
                qualityBg.spriteName = QualityManagerment.qualityIDToBackGround(card.getQualityId());
            }
            if (qualityBg != null)
            {
                qualityBg.gameObject.SetActive(true);
            }
            if (job != null)
            {
                job.text = CardManagerment.Instance.jobIDToString(card.getJob());
            }
            if (job != null)
            {
                job.gameObject.SetActive(true);
            }
            if (jobSprite != null)
            {
                jobSprite.gameObject.SetActive(true);
            }
            if (jobSprite != null)
            {
                jobSprite.spriteName = QualityManagerment.qualityIconBgToBackGround(card.getQualityId());
            }
            if (jobTextSprite != null)
            {
                jobTextSprite.gameObject.SetActive(true);
            }
            if (jobTextSprite != null)
            {
                if (fatherWindow is IntensifyCardShowWindow)
                {
                    jobTextSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.getJob()) + "s";
                }
                else
                {
                    jobTextSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.getJob());
                }
            }
            if (jobBian != null)
            {
                jobBian.gameObject.SetActive(true);
            }
            if (jobBian != null)
            {
                jobBian.spriteName = QualityManagerment.qualityBianToBackGround(card.getQualityId());
            }
            if (levelBg != null)
            {
                levelBg.spriteName = QualityManagerment.qualityBianToBackGround(card.getQualityId());
            }
            if (level != null)
            {
                level.text = "Lv." + card.getLevel(); level.gameObject.SetActive(true);
            }
            updateEvoLevel();
            showEffectByQuality(card.getQualityId());
            showStar();
        }
        else if (sample != null)
        {
            if (inbattle != null)
            {
                inbattle.gameObject.SetActive(false);
            }
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + sample.imageID, icon);
            if (quality != null)
            {
                quality.spriteName = QualityManagerment.qualityIDToString(sample.qualityId);
            }
            if (qualityBg != null)
            {
                qualityBg.spriteName = QualityManagerment.qualityIDToBackGround(sample.qualityId);
            }
            if (job != null)
            {
                job.text = CardManagerment.Instance.jobIDToString(sample.job);
            }
            if (jobSprite != null)
            {
                jobSprite.spriteName = QualityManagerment.qualityIconBgToBackGround(sample.qualityId);
            }
            if (jobTextSprite != null)
            {
                if (fatherWindow is IntensifyCardShowWindow)
                {
                    jobTextSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(sample.job) + "s";
                }
                else
                {
                    jobTextSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(sample.job);
                }
            }
            if (levelBg != null)
            {
                levelBg.spriteName = QualityManagerment.qualityBianToBackGround(sample.qualityId);
            }
            level.text = "Lv." + sample.maxLevel.ToString();             //starLevel;//"Lv.1";
            showStar();
        }
    }
Beispiel #4
0
    public void updateShower(Card newCard)
    {
        gameObject.SetActive(true);
        //动态加载碰撞器
        Object collider = this.gameObject.GetComponent("BoxCollider");

        if (this.name != "cardmain" && collider == null)
        {
            this.gameObject.AddComponent("BoxCollider");
            this.gameObject.GetComponent <BoxCollider> ().isTrigger = true;
            this.gameObject.GetComponent <BoxCollider> ().center    = new Vector3(0, -15, -20);
            this.gameObject.GetComponent <BoxCollider> ().size      = new Vector3(140, 190, 1);
        }
        card = newCard;
        showStar(card);
        prop = null;
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), cardImage);
        if (background != null)
        {
            background.gameObject.SetActive(true);
        }
        if (qualityBg != null)
        {
            qualityBg.gameObject.SetActive(true);
            qualityBg.spriteName = QualityManagerment.qualityIDToBackGround(card.getQualityId());
        }
        if (job != null)
        {
            job.text = CardManagerment.Instance.jobIDToString(card.getJob());
            job.gameObject.SetActive(true);
        }
        if (bian != null)
        {
            bian.spriteName = QualityManagerment.qualityBianToBackGround(card.getQualityId());
            bian.gameObject.SetActive(true);
        }
        if (jobtext != null)
        {
            jobtext.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.getJob());
            jobtext.gameObject.SetActive(true);
        }
        if (jobBg != null)
        {
            jobBg.spriteName = QualityManagerment.qualityIconBgToBackGround(card.getQualityId());
            jobBg.gameObject.SetActive(true);
        }
        if (level != null)
        {
            level.text = "Lv." + card.getLevel();
            level.gameObject.SetActive(true);
        }
        if (inTeamSprite != null)
        {
            inTeamSprite.gameObject.SetActive(card.isInTeam());
        }
//		if (quality != null) {
//			quality.spriteName = QualityManagerment.qualityIDToString (card.getQualityId ());
//			quality.gameObject.SetActive (true);
//		}
        updateEvoLevel();
    }
    public void updateButton(BattleFormationCard newCard, BattleFormationCard brother, int type, int teamIndex, bool isAlter)
    {
//		if (newCard == null)
//			return;
        IsAlternate = isAlter;
        index       = teamIndex;
        showType    = type;
        card        = newCard;
        win         = fatherWindow as BattlePrepareWindowNew;
        //win = fatherWindow as BattlePrepareWindow;
        idss        = win.idss;
        brotherCard = brother;
        if (newCard != null)
        {
            showStar(card.card);
        }
        if (newCard == null)
        {
            if (qualitytopbian != null)
            {
                qualitytopbian.gameObject.SetActive(false);
            }
            if (qualitytopIcon != null)
            {
                qualitytopIcon.gameObject.SetActive(false);
            }
        }
        else
        {
            if (qualitytopbian != null)
            {
                qualitytopbian.gameObject.SetActive(true);
            }
            if (qualitytopIcon != null)
            {
                qualitytopIcon.gameObject.SetActive(true);
            }
        }
        if (newCard != null && qualityBg != null)
        {
            qualityBg.spriteName = QualityManagerment.qualityIDToBackGround(card.card.getQualityId());
        }
        else
        {
            if (qualityBg != null)
            {
                qualityBg.spriteName = QualityManagerment.qualityIDToBackGround(1);
            }
        }
        if (newCard != null && qualitybian != null)
        {
            qualitybian.spriteName = QualityManagerment.qualityBianToBackGround(card.card.getQualityId());
        }
        else
        {
            if (qualitybian != null)
            {
                qualitybian.spriteName = QualityManagerment.qualityBianToBackGround(1);
            }
        }
        if (evoLevel != null)
        {
            evoLevel.gameObject.SetActive(false);
        }

        if (newCard == null)
        {
            cleanButton();
            return;
        }
        else
        {
            if (newCard.card == null)
            {
                cleanButton();
                return;
            }

            //todo hpbar
            hpBar.gameObject.SetActive(true);
            hpBar.updateValue(newCard.getHp(), newCard.getHpMax());
            gameObject.SetActive(true);
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.card.getImageID(), cardImage);
            if (this.spriteBg != null)
            {
                this.spriteBg.spriteName = QualityManagerment.qualityIDToBackGround(card.card.getQualityId());
            }
            if (!isBoss)
            {
                level.gameObject.SetActive(true);
                level.text = "Lv." + card.getLevel();
            }
            else
            {
                //如果是BOSS,就把等级当成血量去显示
                level.text = card.getHp() + "/" + card.getHpMax();
            }
            if (newCard != null && qualitytopbian != null)
            {
                qualitytopbian.spriteName = QualityManagerment.qualityIconBgToBackGround(card.card.getQualityId());
            }
            if (newCard != null && qualitytopIcon != null)
            {
                qualitytopIcon.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(card.card.getJob());
            }
            updateEvoLevel();
        }
    }