//初始化,带入3大类技能的升级信息
 public void Initialize(Equip _equip, LevelupInfo info)
 {
     /* 初始化数据 */
     equip       = _equip;
     equipExpSID = EquipmentSampleManager.Instance.getEquipSampleBySid(equip.sid).levelId;
     nowLv       = info.oldLevel;
     targetLv    = info.newLevel;
     tipNowExp   = info.oldExp;
     updateProgressLabel();
     ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), equipImage);
     qualityBack.spriteName = QualityManagerment.qualityIDToIconSpriteName(equip.getQualityId());
     level.text             = "Lv." + info.oldLevel + "/" + equip.getMaxLevel();
     nameLabel.text         = equip.getName();
     AttrChange[] attrsOld = equip.getAttrChanges(info.oldLevel);
     AttrChange[] attrsNew = equip.getAttrChanges(info.newLevel);
     tipProgressLabel.text = "";
     attrLabel1.text       = "";
     attrLabel2.text       = "";
     if (attrsOld != null)
     {
         if (attrsOld.Length > 0 && attrsOld [0] != null)
         {
             attrLabel1.text = "[6E483F]" + attrsOld[0].typeToString() + attrsOld[0].num + "[-][418159] + " + (attrsNew[0].num - attrsOld[0].num);
         }
         if (attrsOld.Length > 1 && attrsOld [1] != null)
         {
             attrLabel2.text = "[6E483F]" + attrsOld[1].typeToString() + attrsOld[1].num + "[-][418159] + " + (attrsNew[1].num - attrsOld[1].num);
         }
     }
     expbar.init(info);
     /** 进度条升级回调 */
     expbar.setLevelUpCallBack(showLevelupSign);
     /** 进度条动画播完回调 */
     expbar.endCall = OnExpBarEnd;
 }
Ejemplo n.º 2
0
    IEnumerator showEffect()
    {
        MaskWindow.LockUI();
        int count = 0;

        foreach (SacrificeShowerCtrl each in sacrificeRotCtrl.castShowers)
        {
            if (each.card != null)
            {
                yield return(new WaitForSeconds(Random.Range(0.04f, 0.2f)));

                each.cleanData();
                count += 1;
                EffectManager.Instance.CreateEffectCtrlByCache(transform, "Effect/UiEffect/Reinforced_SyntheticONE", (obj, ctrl) => {
                    ctrl.transform.position = each.transform.position;
                });
            }
        }
        yield return(new WaitForSeconds(0.2f));

        EffectManager.Instance.CreateEffectCtrlByCache(transform, "Effect/UiEffect/Reinforced_SyntheticTwo", (obj, bigCtrl) => {
            bigCtrl.transform.position = sacrificeRotCtrl.mainShower.transform.position;
        });
        for (int i = 0; i < count; i++)
        {
            yield return(new WaitForSeconds(Random.Range(0.04f, 0.1f)));

            EffectManager.Instance.CreateEffectCtrlByCache(transform, "Effect/UiEffect/Reinforced_SyntheticThree", (obj, ctrl) => {
                ctrl.transform.position = new Vector3(sacrificeRotCtrl.mainShower.transform.position.x + Random.Range(-1f, 1f), sacrificeRotCtrl.mainShower.transform.position.y + 1f, 0);
                iTween.MoveTo(ctrl.gameObject, iTween.Hash("position", sacrificeRotCtrl.mainShower.transform.position, "easetype", iTween.EaseType.easeOutCubic, "time", 0.3f));
            });
        }
        yield return(new WaitForSeconds(2f));

        if (sacrificeRotCtrl.mainShower.card != null)
        {
            //打开技能升级窗口
            //UiManager.Instance.openWindow<SkillLevelUpWindow>((window) => {
            //    window.Initialize(sacrificeRotCtrl.mainShower.card, cardLvUpInfo, mskillsLvUpInfo, bskillsLvUpInfo, askillsLvUpInfo);
            //    mskillsLvUpInfo = null;
            //    bskillsLvUpInfo = null;
            //    askillsLvUpInfo = null;
            //    cardLvUpInfo = null;
            //});
            UiManager.Instance.openDialogWindow <SkillLvUpWindow>((win) => {
                win.Initialize(sacrificeRotCtrl.mainShower.card, cardLvUpInfo, mskillsLvUpInfo, bskillsLvUpInfo, askillsLvUpInfo);
                mskillsLvUpInfo = null;
                bskillsLvUpInfo = null;
                askillsLvUpInfo = null;
                cardLvUpInfo    = null;
            });
            IntensifyCardManager.Instance.setMainCard(StorageManagerment.Instance.getRole(sacrificeRotCtrl.mainShower.card.uid));
        }
        IntensifyCardManager.Instance.clearFood();
        sacrificeRotCtrl.hideCastShowerbase();
        if (sacrificeRotCtrl.mainShower.card == null)
        {
            MaskWindow.UnlockUI();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 经验条涨
    /// </summary>
    private void updateExpBar()
    {
        LevelupInfo levelupinfo = createLevelupInfo(oldupequip ?? upequip, upequip);

        expLabel.text = EXPSampleManager.Instance.getExpBarShow(upequip.getRefineExpSid(), upequip.getrefineEXP());
        expbar.init(levelupinfo);
        upAnim(levelupinfo);
    }
Ejemplo n.º 4
0
 public void addExpToItem(Dictionary <string, LevelupInfo> dict, string item, int exp)
 {
     if (!dict.ContainsKey(item))
     {
         dict[item] = new LevelupInfo();
     }
     dict[item].addExp(exp);
     //HUD.Instance.updateCurrencies();
 }
Ejemplo n.º 5
0
    public void getOldSkillInfo()
    {
        if (IntensifyCardManager.Instance.getMainCard() == null)
        {
            return;
        }
        Card tmpCard = IntensifyCardManager.Instance.getMainCard();

        Skill[] mskills = tmpCard.getSkills();
        if (mskills != null && mskills.Length > 0)
        {
            mskillsLvUpInfo = new LevelupInfo[mskills.Length];
            for (int i = 0; i < mskills.Length; i++)
            {
                if (mskillsLvUpInfo [i] == null)
                {
                    mskillsLvUpInfo [i] = new LevelupInfo();
                }
                mskillsLvUpInfo [i].oldLevel   = mskills [i].getLevel();
                mskillsLvUpInfo [i].oldExp     = mskills [i].getEXP();
                mskillsLvUpInfo [i].oldExpUp   = mskills [i].getEXPUp();
                mskillsLvUpInfo [i].oldExpDown = mskills [i].getEXPDown();
            }
        }
        Skill[] bskills = tmpCard.getBuffSkills();
        if (bskills != null && bskills.Length > 0)
        {
            bskillsLvUpInfo = new LevelupInfo[bskills.Length];
            for (int i = 0; i < bskills.Length; i++)
            {
                if (bskillsLvUpInfo [i] == null)
                {
                    bskillsLvUpInfo [i] = new LevelupInfo();
                }
                bskillsLvUpInfo [i].oldLevel   = bskills [i].getLevel();
                bskillsLvUpInfo [i].oldExp     = bskills [i].getEXP();
                bskillsLvUpInfo [i].oldExpUp   = bskills [i].getEXPUp();
                bskillsLvUpInfo [i].oldExpDown = bskills [i].getEXPDown();
            }
        }
        Skill[] askills = tmpCard.getAttrSkills();
        if (askills != null && askills.Length > 0)
        {
            askillsLvUpInfo = new LevelupInfo[askills.Length];
            for (int i = 0; i < askills.Length; i++)
            {
                if (askillsLvUpInfo [i] == null)
                {
                    askillsLvUpInfo [i] = new LevelupInfo();
                }
                askillsLvUpInfo [i].oldLevel   = askills [i].getLevel();
                askillsLvUpInfo [i].oldExp     = askills [i].getEXP();
                askillsLvUpInfo [i].oldExpUp   = askills [i].getEXPUp();
                askillsLvUpInfo [i].oldExpDown = askills [i].getEXPDown();
            }
        }
    }
Ejemplo n.º 6
0
 /// <summary>
 /// 开启精炼升级动画
 /// </summary>
 /// <param name="levelupinfo"></param>
 private void upAnim(LevelupInfo levelupinfo)
 {
     if (levelupinfo.newLevel > levelupinfo.oldLevel)
     {
         NGUITools.AddChild(bg, upanimation);
     }
     updateContent();
     oldupequip = null;
 }
Ejemplo n.º 7
0
    /// <summary>
    /// 经验条
    /// </summary>
    private void updateExpBar()
    {
        MountsManagerment manager = MountsManagerment.Instance;

        expLabel.text       = EXPSampleManager.Instance.getExpBarShow(EXPSampleManager.SID_MOUNTS_EXP, manager.getMountsExp());
        skillLevelText.text = "Lv." + manager.getMountsLevel();
        LevelupInfo levelupInfo = manager.createLevelupInfo();

        skillExpBar.init(levelupInfo);
    }
Ejemplo n.º 8
0
    //初始化,带入3大类技能的升级信息
    public void Initialize(Card role, LevelupInfo info, LevelupInfo[] msk, LevelupInfo[] bsk, LevelupInfo[] ask)
    {
        this.card            = role;
        this.mskillsLvUpInfo = msk;
        this.bskillsLvUpInfo = bsk;
        this.askillsLvUpInfo = ask;

        step       = 0;
        nextSetp   = 1;
        canRefresh = true;
    }
Ejemplo n.º 9
0
 //初始化经验条
 private void initExp()
 {
     lvinfo            = new LevelupInfo();
     lvinfo.newExp     = oldExp;
     lvinfo.newExpDown = EXPSampleManager.Instance.getEXPDown(EXPSampleManager.SID_HALLOW_EXP, expToLevel(oldExp));
     lvinfo.newExpUp   = EXPSampleManager.Instance.getEXPUp(EXPSampleManager.SID_HALLOW_EXP, expToLevel(oldExp));
     lvinfo.newLevel   = expToLevel(oldExp);
     lvinfo.oldExp     = oldExp;
     lvinfo.oldExpDown = EXPSampleManager.Instance.getEXPDown(EXPSampleManager.SID_HALLOW_EXP, expToLevel(oldExp));
     lvinfo.oldExpUp   = EXPSampleManager.Instance.getEXPUp(EXPSampleManager.SID_HALLOW_EXP, expToLevel(oldExp));
     lvinfo.oldLevel   = expToLevel(oldExp);
     lvinfo.orgData    = null;
 }
Ejemplo n.º 10
0
 private void _clickClose(IUIObject _obj)
 {
     if (this.levelupInfoQueue.Count > 0)
     {
         this.showLevelupInfo  = this.levelupInfoQueue.Dequeue();
         this.levelupInfoIndex = 0;
         this.SetInfo();
     }
     else
     {
         this.Close();
     }
 }
Ejemplo n.º 11
0
 //设置强化前主卡技能信息
 public void setOldSkillInfo()
 {
     Skill[] mskills = mainCard.getSkills();
     if (mskills != null && mskills.Length > 0)
     {
         mskillsLvUpInfo = new LevelupInfo[mskills.Length];
         for (int i = 0; i < mskills.Length; i++)
         {
             if (mskillsLvUpInfo [i] == null)
             {
                 mskillsLvUpInfo [i] = new LevelupInfo();
             }
             mskillsLvUpInfo [i].oldLevel   = mskills [i].getLevel();
             mskillsLvUpInfo [i].oldExp     = mskills [i].getEXP();
             mskillsLvUpInfo [i].oldExpUp   = mskills [i].getEXPUp();
             mskillsLvUpInfo [i].oldExpDown = mskills [i].getEXPDown();
         }
     }
     Skill[] bskills = mainCard.getBuffSkills();
     if (bskills != null && bskills.Length > 0)
     {
         bskillsLvUpInfo = new LevelupInfo[bskills.Length];
         for (int i = 0; i < bskills.Length; i++)
         {
             if (bskillsLvUpInfo [i] == null)
             {
                 bskillsLvUpInfo [i] = new LevelupInfo();
             }
             bskillsLvUpInfo [i].oldLevel   = bskills [i].getLevel();
             bskillsLvUpInfo [i].oldExp     = bskills [i].getEXP();
             bskillsLvUpInfo [i].oldExpUp   = bskills [i].getEXPUp();
             bskillsLvUpInfo [i].oldExpDown = bskills [i].getEXPDown();
         }
     }
     Skill[] askills = mainCard.getAttrSkills();
     if (askills != null && askills.Length > 0)
     {
         askillsLvUpInfo = new LevelupInfo[askills.Length];
         for (int i = 0; i < askills.Length; i++)
         {
             if (askillsLvUpInfo [i] == null)
             {
                 askillsLvUpInfo [i] = new LevelupInfo();
             }
             askillsLvUpInfo [i].oldLevel   = askills [i].getLevel();
             askillsLvUpInfo [i].oldExp     = askills [i].getEXP();
             askillsLvUpInfo [i].oldExpUp   = askills [i].getEXPUp();
             askillsLvUpInfo [i].oldExpDown = askills [i].getEXPDown();
         }
     }
 }
Ejemplo n.º 12
0
 public void Show(LevelupInfo levelupInfo)
 {
     if (this.showLevelupInfo == null)
     {
         this.showLevelupInfo = levelupInfo;
         this.SetInfo();
         base.Show();
         this.canPlayEffect = true;
     }
     else
     {
         this.levelupInfoQueue.Enqueue(levelupInfo);
     }
 }
    /** 初始化新经验条 */
    private LevelupInfo createLevelupInfo(StarSoul oldStarSoul, StarSoul newStarSoul)
    {
        LevelupInfo levelupInfo = new LevelupInfo();

        levelupInfo.newExp     = newStarSoul.getEXP();
        levelupInfo.newExpDown = EXPSampleManager.Instance.getEXPDown(newStarSoul.getEXPSid(), newStarSoul.getLevel());
        levelupInfo.newExpUp   = EXPSampleManager.Instance.getEXPUp(newStarSoul.getEXPSid(), newStarSoul.getLevel());
        levelupInfo.newLevel   = newStarSoul.getLevel();
        levelupInfo.oldExp     = oldStarSoul.getEXP();
        levelupInfo.oldExpDown = EXPSampleManager.Instance.getEXPDown(oldStarSoul.getEXPSid(), oldStarSoul.getLevel());
        levelupInfo.oldExpUp   = EXPSampleManager.Instance.getEXPUp(oldStarSoul.getEXPSid(), oldStarSoul.getLevel());
        levelupInfo.oldLevel   = oldStarSoul.getLevel();
        return(levelupInfo);
    }
Ejemplo n.º 14
0
    public void getOldCardInfo()
    {
        if (IntensifyCardManager.Instance.getMainCard() == null)
        {
            return;
        }
        Card tmpCard = IntensifyCardManager.Instance.getMainCard();

        cardLvUpInfo            = new LevelupInfo();
        cardLvUpInfo.oldLevel   = tmpCard.getLevel();
        cardLvUpInfo.oldExp     = tmpCard.getEXP();
        cardLvUpInfo.oldExpUp   = tmpCard.getEXPUp();
        cardLvUpInfo.oldExpDown = tmpCard.getEXPDown();
        cardLvUpInfo.orgData    = tmpCard.Clone();
    }
Ejemplo n.º 15
0
    /** 初始化经验条信息 */
    LevelupInfo initExp(long _oldExp, long _newExp)
    {
        LevelupInfo lvinfo = new LevelupInfo();

        lvinfo.newExp     = _newExp;
        lvinfo.newExpDown = MountsManagerment.Instance.getEXPDown(expToLevel(_newExp));
        lvinfo.newExpUp   = MountsManagerment.Instance.getEXPUp(expToLevel(_newExp));
        lvinfo.newLevel   = expToLevel(_newExp);
        lvinfo.oldExp     = _oldExp;
        lvinfo.oldExpDown = MountsManagerment.Instance.getEXPDown(expToLevel(_oldExp));
        lvinfo.oldExpUp   = MountsManagerment.Instance.getEXPUp(expToLevel(_oldExp));
        lvinfo.oldLevel   = expToLevel(_oldExp);
        lvinfo.orgData    = null;
        return(lvinfo);
    }
    /// <summary>
    /// 经验条飞
    /// </summary>
    private void updateExpBar()
    {
        LevelupInfo levelupInfo;

        if (oldStarSoul == null)
        {
            levelupInfo = createLevelupInfo(starSoul, starSoul);
        }
        else
        {
            levelupInfo = createLevelupInfo(oldStarSoul, starSoul);
        }
        expLabel.text = EXPSampleManager.Instance.getExpBarShow(starSoul.getEXPSid(), starSoul.getEXP());
        expBar.init(levelupInfo);
    }
Ejemplo n.º 17
0
    //获取献祭前主卡技能信息
    public void  getOldSkillInfo()
    {
        if (hasMainEquip() == false)
        {
            return;
        }

        Equip tmpEquip = main.equip;

        levelInfo = new LevelupInfo();

        levelInfo.oldLevel   = tmpEquip.getLevel();
        levelInfo.oldExp     = tmpEquip.getEXP();
        levelInfo.oldExpUp   = tmpEquip.getEXPUp();
        levelInfo.oldExpDown = tmpEquip.getEXPDown();
    }
Ejemplo n.º 18
0
    /** 初始化经验条信息 */
    public LevelupInfo createLevelupInfo()
    {
        MountsManagerment manager = MountsManagerment.Instance;
        long        oldExp        = manager.getMountsExp();
        LevelupInfo lvinfo        = new LevelupInfo();

        lvinfo.newExp     = oldExp;
        lvinfo.newExpDown = manager.getEXPDown(expToLevel(oldExp));
        lvinfo.newExpUp   = manager.getEXPUp(expToLevel(oldExp));
        lvinfo.newLevel   = expToLevel(oldExp);
        lvinfo.oldExp     = oldExp;
        lvinfo.oldExpDown = manager.getEXPDown(expToLevel(oldExp));
        lvinfo.oldExpUp   = manager.getEXPUp(expToLevel(oldExp));
        lvinfo.oldLevel   = expToLevel(oldExp);
        lvinfo.orgData    = null;
        return(lvinfo);
    }
Ejemplo n.º 19
0
 public void SetLevelupInfo(int level, string texture, string explain)
 {
     if (string.IsNullOrEmpty(texture) || string.IsNullOrEmpty(explain))
     {
         return;
     }
     if (this.dic_levelupInfo.ContainsKey(level))
     {
         this.dic_levelupInfo[level].AddTexExplain(texture, explain);
     }
     else
     {
         LevelupInfo levelupInfo = new LevelupInfo(level);
         levelupInfo.AddTexExplain(texture, explain);
         this.dic_levelupInfo.Add(level, levelupInfo);
     }
 }
Ejemplo n.º 20
0
    private LevelupInfo createLevelupInfo(Equip oldupequip, Equip newupequip)
    {
        LevelupInfo levelupinfo = new LevelupInfo
        {
            newExp     = newupequip.getrefineEXP(),
            newExpDown =
                EXPSampleManager.Instance.getRefineEXPDown(newupequip.getRefineExpSid(), newupequip.getrefineLevel()),
            newExpUp =
                EXPSampleManager.Instance.getRefineEXPUp(newupequip.getRefineExpSid(), newupequip.getrefineLevel()),
            newLevel   = newupequip.getrefineLevel(),
            oldExp     = oldupequip.getrefineEXP(),
            oldExpDown =
                EXPSampleManager.Instance.getRefineEXPDown(oldupequip.getRefineExpSid(), oldupequip.getrefineLevel()),
            oldExpUp =
                EXPSampleManager.Instance.getRefineEXPUp(oldupequip.getRefineExpSid(), oldupequip.getrefineLevel()),
            oldLevel = oldupequip.getrefineLevel()
        };

        return(levelupinfo);
    }
Ejemplo n.º 21
0
    //_type 指定的话,一般用于skill为空的时候
    public void updateButton(LevelupInfo data, Card card)
    {
        this.card = card;
        skillData = (Skill)data.orgData;
        int skillType = 0;

        barCtrl.init(data);
        barCtrl.setLevelUpCallBack(onLevelUp);
        barCtrl.endCall = levelUpEffect;
        if (data != null)
        {
            skillType       = skillData.getSkillStateType();
            levelNow        = data.oldLevel;
            skillLevel.text = "Lv." + levelNow + "/" + Mathf.Min(skillData.getMaxLevel(), card.getLevel() + 5);
            textLabel.text  = skillData.getName();
            skillDesc.text  = skillData.getDescribeByLv(levelNow);
            expLabel.text   = skillData.getEXP() + "/" + skillData.getEXPUp();
        }

        if (skillData != null)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(skillData.getIcon(), skillIcon);
        }
        else
        {
            if (skillType == TYPE_RED)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.SKILLIMAGEPATH + "Skill_Null", skillIcon);
            }
            else if (skillType == TYPE_YELLOW)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.SKILLIMAGEPATH + "Skill_Null", skillIcon);
            }
            else if (skillType == TYPE_BLUE)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.SKILLIMAGEPATH + "Skill_Null", skillIcon);
            }
        }
    }
Ejemplo n.º 22
0
    /// <summary>
    /// 更新属性
    /// </summary>
    /// <param name="index">次序</param>
    /// <param name="textName">附加属性文本</param>
    /// <param name="oldExp">老附加属性经验</param>
    /// <param name="attrExp">新附加属性经验</param>
    /// <param name="oldAttr">原始属性值</param>
    /// <param name="attr">附加属性值</param>
    public bool updateAttributes(int index, string textName, int oldExp, long newExp, int oldAttr, int attr)
    {
        if (newExp >= EXPSampleManager.Instance.getMaxExp(EXPSampleManager.SID_USER_ATTR_ADD_EXP))
        {
            return(false);
        }

        // 获得经验对于的卡片附加等级
        int currentGrade = Card.getAttrAddGrade(newExp);
        // 获得经验对于的卡片附加等级
        int oldGrade = Card.getAttrAddGrade(oldExp);
        // 增加等级
        int addGrade = currentGrade - oldGrade;
        // 最大等级
        int maxGrade = EXPSampleManager.Instance.getMaxLevel(EXPSampleManager.SID_USER_ATTR_ADD_EXP) - 1;
        // 老等级段经验下线
        long oldExpNow = EXPSampleManager.Instance.getEXPDown(EXPSampleManager.SID_USER_ATTR_ADD_EXP, oldGrade + 1);
        // 老等级段经验上线
        long oldExpMax = EXPSampleManager.Instance.getEXPUp(EXPSampleManager.SID_USER_ATTR_ADD_EXP, oldGrade + 1);

        // 当前等级段经验下线
        long currentExpNow = EXPSampleManager.Instance.getEXPDown(EXPSampleManager.SID_USER_ATTR_ADD_EXP, currentGrade + 1);
        // 当前等级段经验上线
        long currentExpMax = EXPSampleManager.Instance.getEXPUp(EXPSampleManager.SID_USER_ATTR_ADD_EXP, currentGrade + 1);

        LevelupInfo info = new LevelupInfo();

        info.oldLevel   = oldGrade;
        info.newLevel   = currentGrade;
        info.oldExp     = oldExp;
        info.newExp     = newExp;
        info.oldExpUp   = oldExpMax;
        info.oldExpDown = oldExpNow;
        info.newExpUp   = currentExpMax;
        info.newExpDown = currentExpNow;
        expBar.init(info);
        setLevelLabel(currentGrade, maxGrade);
        setTextNameLabel("attr_" + textName);
        if (attr > 0)
        {
            setTextValueLabel(oldAttr.ToString() + "[64ED6E]+" + attr.ToString());
        }
        else
        {
            setTextValueLabel(oldAttr.ToString());
        }
        bool isUpLevel = false;

        if (newExp >= EXPSampleManager.Instance.getMaxExp(EXPSampleManager.SID_USER_ATTR_ADD_EXP))
        {
            gameObject.SetActive(false);
        }
        else
        {
            gameObject.SetActive(true);
            // 等级提升特效
            if (addGrade > 0)
            {
                if (index < 3)
                {
                    expBar.endCall = ShowUpEffect;
                }
                else
                {
                    textValueLabel.gameObject.SetActive(true);
                }
                isUpLevel = true;
            }
        }
        return(isUpLevel);
    }
Ejemplo n.º 23
0
    public void Initialize(Card _oldCard, Card _newCard, CallBack _callBack)
    {
        this.callBack = _callBack;
        //先存好经验
        LevelupInfo info = new LevelupInfo();

        info.oldLevel   = _oldCard.getLevel();
        info.oldExp     = _oldCard.getEXP();
        info.oldExpUp   = _oldCard.getEXPUp();
        info.oldExpDown = _oldCard.getEXPDown();
        info.orgData    = _oldCard.Clone();

        info.newLevel   = _newCard.getLevel();
        info.newExp     = _newCard.getEXP();
        info.newExpUp   = _newCard.getEXPUp();
        info.newExpDown = _newCard.getEXPDown();

        //然后存卡片技能经验
        LevelupInfo[] msk        = null;
        Skill[]       oldMskills = _oldCard.getSkills();
        Skill[]       newMskills = _newCard.getSkills();
        if (oldMskills != null && oldMskills.Length > 0)
        {
            msk = new LevelupInfo[oldMskills.Length];
            for (int i = 0; i < oldMskills.Length; i++)
            {
                if (msk [i] == null)
                {
                    msk [i] = new LevelupInfo();
                }
                msk [i].oldLevel   = oldMskills [i].getLevel();
                msk [i].oldExp     = oldMskills [i].getEXP();
                msk [i].oldExpUp   = oldMskills [i].getEXPUp();
                msk [i].oldExpDown = oldMskills [i].getEXPDown();

                msk [i].newLevel   = newMskills [i].getLevel();
                msk [i].newExp     = newMskills [i].getEXP();
                msk [i].newExpUp   = newMskills [i].getEXPUp();
                msk [i].newExpDown = newMskills [i].getEXPDown();
                msk [i].orgData    = newMskills [i];
            }
        }

        LevelupInfo[] bsk        = null;
        Skill[]       oldBskills = _oldCard.getBuffSkills();
        Skill[]       newBskills = _newCard.getBuffSkills();
        if (oldBskills != null && oldBskills.Length > 0)
        {
            bsk = new LevelupInfo[oldBskills.Length];
            for (int i = 0; i < oldBskills.Length; i++)
            {
                if (bsk [i] == null)
                {
                    bsk [i] = new LevelupInfo();
                }
                bsk [i].oldLevel   = oldBskills [i].getLevel();
                bsk [i].oldExp     = oldBskills [i].getEXP();
                bsk [i].oldExpUp   = oldBskills [i].getEXPUp();
                bsk [i].oldExpDown = oldBskills [i].getEXPDown();

                bsk [i].newLevel   = newBskills [i].getLevel();
                bsk [i].newExp     = newBskills [i].getEXP();
                bsk [i].newExpUp   = newBskills [i].getEXPUp();
                bsk [i].newExpDown = newBskills [i].getEXPDown();
                bsk [i].orgData    = newBskills [i];
            }
        }

        LevelupInfo[] ask        = null;
        Skill[]       oldAskills = _oldCard.getAttrSkills();
        Skill[]       newAskills = _newCard.getAttrSkills();
        if (oldAskills != null && oldAskills.Length > 0)
        {
            ask = new LevelupInfo[oldAskills.Length];
            for (int i = 0; i < oldAskills.Length; i++)
            {
                if (ask [i] == null)
                {
                    ask [i] = new LevelupInfo();
                }
                ask [i].oldLevel   = oldAskills [i].getLevel();
                ask [i].oldExp     = oldAskills [i].getEXP();
                ask [i].oldExpUp   = oldAskills [i].getEXPUp();
                ask [i].oldExpDown = oldAskills [i].getEXPDown();

                ask [i].newLevel   = newAskills [i].getLevel();
                ask [i].newExp     = newAskills [i].getEXP();
                ask [i].newExpUp   = newAskills [i].getEXPUp();
                ask [i].newExpDown = newAskills [i].getEXPDown();
                ask [i].orgData    = newAskills [i];
            }
        }

        Initialize(_newCard, info, msk, bsk, ask);
    }
Ejemplo n.º 24
0
    //初始化,带入3大类技能的升级信息
    public void Initialize(Card role, LevelupInfo info, LevelupInfo[] msk, LevelupInfo[] bsk, LevelupInfo[] ask)
    {
        this.card            = role;
        this.mskillsLvUpInfo = msk;
        this.bskillsLvUpInfo = bsk;
        this.askillsLvUpInfo = ask;
        this.cardLvUpInfo    = info;
        oldCard         = info.orgData as Card;
        cardimage.alpha = 0;
        ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + role.getImageID(), cardimage);
        CardBaseAttribute attrOldEff = CardManagerment.Instance.getCardWholeAttr(oldCard);
        CardBaseAttribute attrNewEff = CardManagerment.Instance.getCardWholeAttr(role);
        CardBaseAttribute attrAddon  = CardManagerment.Instance.getCardAppendEffectNoSuit(role);

        _oldAttr = new int[5] {
            attrOldEff.getWholeHp(),
                attrOldEff.getWholeAtt(),
                attrOldEff.getWholeDEF(),
                attrOldEff.getWholeMAG(),
                attrOldEff.getWholeAGI()
        };
        _newAttr = new int[5] {
            attrNewEff.getWholeHp(),
                attrNewEff.getWholeAtt(),
                attrNewEff.getWholeDEF(),
                attrNewEff.getWholeMAG(),
                attrNewEff.getWholeAGI()
        };
        _addAttr = new int[5] {
            (attrNewEff.getWholeHp() - attrOldEff.getWholeHp()),
            (attrNewEff.getWholeAtt() - attrOldEff.getWholeAtt()),
            (attrNewEff.getWholeDEF() - attrOldEff.getWholeDEF())
            ,
            (attrNewEff.getWholeMAG() - attrOldEff.getWholeMAG()),
            (attrNewEff.getWholeAGI() - attrOldEff.getWholeAGI())
        };
        _step = new int[5] {
            setStep(attrOldEff.getWholeHp(), attrNewEff.getWholeHp()),
            setStep(attrOldEff.getWholeAtt(), attrNewEff.getWholeAtt()),
            setStep(attrOldEff.getWholeDEF(), attrNewEff.getWholeDEF()),
            setStep(attrOldEff.getWholeMAG(), attrNewEff.getWholeMAG()),
            setStep(attrOldEff.getWholeAGI(), attrNewEff.getWholeAGI())
        };
        _addonAttr = new int[5] {
            attrAddon.getWholeHp(),
                attrAddon.getWholeAtt(),
                attrAddon.getWholeDEF(),
                attrAddon.getWholeMAG(),
                attrAddon.getWholeAGI()
        };
        _addonAttrLv = new int[] {
            CardManagerment.Instance.getCardAttrAppendLevel(role, AttributeType.hp),
            CardManagerment.Instance.getCardAttrAppendLevel(role, AttributeType.attack),
            CardManagerment.Instance.getCardAttrAppendLevel(role, AttributeType.defecse),
            CardManagerment.Instance.getCardAttrAppendLevel(role, AttributeType.magic),
            CardManagerment.Instance.getCardAttrAppendLevel(role, AttributeType.agile),
        };

        cardName.text = QualityManagerment.getQualityColor(role.getQualityId()) + role.getName();
        int jobId = role.getJob();

        jobSprite.spriteName = CardManagerment.Instance.qualityIconTextToBackGround(jobId) + "s";
        //属性界面“力”系背景(力系和毒系职业用)
        if (jobId == 1 || jobId == 4)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.BACKGROUNDPATH + "card_topBackGround_1", topBackGround);
        }
        //属性界面“敏”系背景(反和敏职业用)
        else if (jobId == 3 || jobId == 5)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.BACKGROUNDPATH + "card_topBackGround_2", topBackGround);
        }
        //属性界面“魔”系背景(魔和辅职业用)
        else
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.BACKGROUNDPATH + "card_topBackGround_3", topBackGround);
        }
        nowLv                = oldCard.getLevel();
        levelLabel.text      = "Lv." + nowLv + "/" + role.getMaxLevel();
        evoSprite.spriteName = card.isMainCard() ? "attr_evup" : "attr_ev";
        if (EvolutionManagerment.Instance.getMaxLevel(role) == 0)
        {
            evoLabel.text = LanguageConfigManager.Instance.getLanguage("Evo10");
        }
        else
        {
            evoLabel.text = role.isMainCard()?
                            role.getSurLevel() + "/" + SurmountManagerment.Instance.getMaxSurLevel(role):
                            role.getEvoLevel() + "/" + role.getMaxEvoLevel();
        }

        combat.text = " " + CombatManager.Instance.getCardCombat(oldCard);

        for (int i = 0; i < attrLabels.Length; i++)
        {
            attrLabels [i].text = _oldAttr [i] + "";
        }

        for (int i = 0; i < addAttrLabels.Length; i++)
        {
            addAttrLabels [i].text = "";
        }

        StartCoroutine(Utils.DelayRun(() => {
            canSeeAddon = false;
            step        = 0;
            nextSetp    = 1;
            canRefresh  = true;
            MaskWindow.LockUI();
        }, 0.5f));
    }
Ejemplo n.º 25
0
    //

    public void init(LevelupInfo info)
    {
        if (SliderBar != null)
        {
            SliderBar.value = 0;
        }
        if (FrontBar != null)
        {
            FrontBar.fillAmount = 0;
        }

        ExpNow     = 0;
        hasTrigger = false;

        expAll  = info.newExp - info.oldExp;
        expTime = expAll;

        LevelNow = info.oldLevel;
        // 老等级升级所需要的经验
        long length    = info.oldExpUp - info.oldExpDown;
        long newLength = length;

        // 老等级多出的经验
        ExpNow = info.oldExp - info.oldExpDown;
        // 新等级多出的经验
        ExpTarget  = info.newExp - info.newExpDown;
        levelcount = info.newLevel - info.oldLevel;
        if (levelcount > 0)
        {
            //新等级升级所需要的经验
            newLength = info.newExpUp - info.newExpDown;
        }

        if (newLength == 0)
        {
            newLength   = ExpTarget;
            finishPoint = 1;
        }
        else
        {
            finishPoint = (float)ExpTarget / (float)newLength;
        }

        //如果满了 那么显示条直接填满
        if (finishPoint >= 1)
        {
            finishPoint     = 0.99f;
            SliderBar.value = 1;
        }

        if (length == 0)
        {
            return;
        }
        startPoint = (float)ExpNow / (float)length;
        if (startPoint == 1)        //起始点不可能是1
        {
            startPoint = 0;
        }

        if (SliderBar != null)
        {
            SliderBar.value = startPoint;
        }
        if (FrontBar != null)
        {
            FrontBar.fillAmount = startPoint;
        }

        beginExpAnim = true;
        if (levelcount > 1)
        {
            sp = (int)((float)expAll / (levelcount * 4f));
        }
        else
        {
            sp = (int)((float)expAll / 4);
        }
    }