Exemplo n.º 1
0
 public void Destroy()
 {
     if (mInstance != null)
     {
         Destroy(this.gameObject);
         _mInstance = null;
         UIDownModel.CloesWin();
     }
 }
Exemplo n.º 2
0
    public bool FreshSelMonster()
    {
        bool AllFated = false;

        List <Skill> monsterSkill = _CurMonster.getSkill;

        lab_PetName.text = _CurMonster.config.name;

        if (monsterSkill == null)
        {
            return(false);
        }

        m_skillTable.RefreshSkillTable(monsterSkill);

        List <FateData> fateList = _CurMonster.getMyFate(Core.Data.fateManager);

        int count = fateList.Count;

        List <int> atkEffect = new List <int>();
        List <int> defEffect = new List <int>();

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

        for (int i = 0; i < count; i++)
        {
            sz_SkillNames[i].text = fateList[i].name;
            if (_CurMonster.checkMyFate(fateList[i], curTeam, Core.Data.dragonManager.usedToList()))
            {
                value++;

                sz_SkillNames[i].color = new Color(1f, 227f / 255, 43f / 255);

                CheckMonEffect(i);
                if (fateList[i].effect[FateData.EFFECT_SELF_ATTACK] > 0)
                {
                    atkEffect.Add(fateList[i].effect[FateData.EFFECT_SELF_ATTACK]);
                }
                else
                {
                    defEffect.Add(fateList[i].effect[FateData.EFFECT_SELF_ATTACK]);
                }
            }
            else
            {
                sz_SkillNames[i].color = Color.gray;
            }
        }


        if (value == count)
        {
            AllFated = true;
        }

//		int nextExp = Core.Data.monManager.getMonsterNextLvExp(_CurMonster.Star, _CurMonster.RTData.curLevel);


//		float tValue = (float)(_CurMonster.RTData.curExp) / (float)(nextExp);

        lab_PetLevel.text = "Lv" + _CurMonster.RTData.curLevel.ToString();

        float atkPer = 0;
        float defPer = 0;

        for (int i = 0; i < atkEffect.Count; i++)
        {
            atkPer += atkEffect[i];
        }
        for (int i = 0; i < defEffect.Count; i++)
        {
            defPer += defEffect[i];
        }

        int pos = curTeam.GetMonsterPos(_CurMonster.pid);

        lab_PetAttack.text = curTeam.MemberAttack(pos).ToString();

        lab_PetDefense.text = curTeam.MemberDefend(pos).ToString();


        if (Core.Data.temper.tempId == _CurMonster.pid && Core.Data.temper.tempId != 0)
        {
            if (Core.Data.temper.infoPetAtk != 0)
            {
                Core.Data.temper.deltaInfoAtk = curTeam.MemberAttack(pos) - Core.Data.temper.infoPetAtk;
            }
            if (Core.Data.temper.infoPetDef != 0)
            {
                Core.Data.temper.deltaInfoDef = curTeam.MemberDefend(pos) - Core.Data.temper.infoPetDef;
            }
            this.ShowUpdate();
        }

        Core.Data.temper.tempId     = _CurMonster.pid;
        Core.Data.temper.infoPetAtk = curTeam.MemberAttack(pos);
        Core.Data.temper.infoPetDef = curTeam.MemberDefend(pos);


        sp_Attribute.spriteName = "Attribute_" + ((int)(_CurMonster.RTData.Attribute)).ToString();

        RED.SetActive(_CurMonster.config.jinjie == 1, m_extStars.gameObject);
        m_stars.SetStar(_CurMonster.Star);
        m_extStars.SetStar(6);

        //Core.Data.temper.bagSelectMonster = null;
        Core.Data.temper.curShowMonster = _CurMonster;

#if SPLIT_MODEL
        if (!Core.Data.sourceManager.IsModelExist(_CurMonster.num))
        {
            UIDownModel.OpenDownLoadUI(_CurMonster.num, DownLoadFinish, new Vector3(10, -135, 0));
        }
        else
        {
            UIDownModel.CloesWin();
        }
#endif
        return(AllFated);
    }
Exemplo n.º 3
0
    private void InitUI()
    {
        #if SPLIT_MODEL
        if (!Core.Data.sourceManager.IsModelExist(m_data.num))
        {
            UIDownModel.OpenDownLoadUI(m_data.num, DownLoadFinish, new Vector3(-368, -100, -30));
            UIDownModel.mInstance.gameObject.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
        }
        else
        {
            UIDownModel.CloesWin();
        }
        #endif
        if (m_data != null)
        {
            fDateList.Clear();
            m_txtDesp.text = m_data.config.description;

            //init skills
            List <Skill> skillList = m_data.getSkill;
            int          index     = 0;
            for (; index < skillList.Count; index++)
            {
                skills[index].Show(skillList[index], index / 2);
            }

            for (; index < 3; index++)
            {
                skills[index].Show(null, index / 2);
            }

            //阵容界面 隐藏
            if (curType == ShowFatePanelController.FateInPanelType.isInTeamModifyPanel)
            {
                for (int i = 0; i < UIFateBtn.Length; i++)
                {
                    UIFateBtn [i].gameObject.SetActive(false);
                }
            }
            //init fate
            List <FateData> o = m_data.getMyFate(Core.Data.fateManager);

            fDateList = o;
            List <AoYi> aoyiList = Core.Data.dragonManager.usedToList();
            MonsterTeam myteam   = Core.Data.playerManager.RTData.curTeam;
            int         count    = o.Count;

            int allSet = 0;

            lblDesp.gameObject.transform.localPosition = DespStartPos + Vector3.down * count * 60;
            titleObj.transform.localPosition           = titleStartPos + Vector3.down * count * 60;
            lblDesp.text  = string.Format(Core.Data.stringManager.getString(7336), m_data.config.nuqi1.ToString());;
            lblTitle.text = Core.Data.stringManager.getString(7335);

            for (int i = 0; i < count; i++)
            {
                m_txtFataTitle[i].text = o[i].name;
                string tColor = "";
                if (m_data.checkMyFate(o[i], myteam, aoyiList))
                {
                    m_txtFataTitle[i].color = new Color(1f, 227f / 255, 43f / 255);
                    //	m_txtFate[i].color = new Color (1f,227f/255,43f/255);
                    tColor = strColor;
                    allSet++;
                }
                else
                {
                    m_txtFataTitle[i].color = Color.white;
                    m_txtFate[i].color      = Color.white;
                }
                string addAng = string.Format(Core.Data.stringManager.getString(1008), o[i].nuqi.ToString());
                m_txtFate[i].text = tColor + o[i].description + addAng;
            }
            if (count != 0)
            {
                if (allSet == count)
                {
                    // lblDesp.color = new Color (1f, 227f / 255f, 43f / 255f, 1f);
                    lblDesp.text   = strColor + lblDesp.text;
                    lblTitle.color = new Color(1f, 227f / 255f, 43f / 255f, 1f);
                }
                else
                {
                    lblTitle.color = Color.white;
                    lblDesp.color  = Color.white;
                }
            }
            else
            {
                lblDesp.gameObject.SetActive(false);
                titleObj.gameObject.SetActive(false);
            }

            for (int i = count; i < m_txtFate.Length; i++)
            {
                RED.SetActive(false, m_txtFate[i].gameObject, m_fateBg[i]);
                // ad by wxl
                RED.SetActive(false, UIFateBtn[i].gameObject);
            }

            m_3dCard.Show3DCard(m_data, false);
            m_btnSkillUp.TextID    = 5233;
            m_btnSkillUp.isEnabled = !Core.Data.monManager.IsExpMon(m_data.config.ID) && m_bOperate;
        }
    }