//单抽显示所有按钮
    void SetSingleBtn()
    {
        mAllOk.gameObject.SetActive(true);
        mAllOk.Text = Core.Data.stringManager.getString(25098);
        if (m_IsStone)
        {
            m_MoneyIcon.spriteName = "common-0014";
        }
        else
        {
            m_MoneyIcon.spriteName = "common-0013";
        }
        m_MoneyNum.SafeText(m_NeedMoney.ToString());
        if (CradSystemFx.GetInstance().m_AbleRepay)
        {
            m_AgainBtnRoot.gameObject.SetActive(true);
        }

#if NEWEGG
                #if SPLIT_MODEL
        if (!Core.Data.sourceManager.IsModelExist(this._rewards[0].pid))
        {
            UIDownModel.OpenDownLoadUI(this._rewards[0].pid, DownLoadSingleFinish, null, UIDownModel.WinType.WT_Two);
        }
        else
        {
            ;
        }
                #else
                #endif
#else
#endif
    }
 public static void OpenDownLoadUI(int monID, DelegateLoadFinished callBack, DelegateCloes close = null, WinType type = WinType.WT_One)
 {
     if (_instance == null)
     {
         UIDownModel modeWin = UIDownModel.CreateWin(type);
         if (modeWin != null)
         {
             _instance = modeWin;
             if (type == WinType.WT_One)
             {
                 if (TeamUI.mInstance != null)
                 {
                     modeWin.SetWinRoot(TeamUI.mInstance.m_teamView.gameObject);
                 }
                 else
                 {
                     modeWin.SetWinRoot(DBUIController.mDBUIInstance._TopRoot);
                 }
             }
             else
             {
                 modeWin.SetWinRoot(DBUIController.mDBUIInstance._TopRoot);
             }
         }
     }
     _instance.SetDownloadModel(monID, callBack);
     _instance.m_EventCloes = close;
 }
    public void SetCardSinglePanel(ItemOfReward[] rewards, int _NeedMoney, bool isShowEgg = true, bool _IsStnoe = true, bool _AbleRepay = true)
    {
        UIMiniPlayerController.Instance.SetActive(false);
        mItemOfReward  = rewards;
        SingleRewardId = mItemOfReward[0].pid;
        bShowEgg       = isShowEgg;
        m_NeedMoney    = _NeedMoney;
        m_AbleRepay    = _AbleRepay;
        m_IsStone      = _IsStnoe;
#if NEWEGG
        SingleDownload();
#else
                #if SPLIT_MODEL
        if (!Core.Data.sourceManager.IsModelExist(rewards[0].pid))
        {
            UIDownModel.OpenDownLoadUI(rewards[0].pid, DownLoadSingle, SingleDownload, UIDownModel.WinType.WT_Two);
        }
        else
        {
            DownLoadSingle(null);
        }
                #else
        DownLoadSingle(null);
                #endif
#endif
    }
	void OnClick()
	{
#if SPLIT_MODEL
		if (!Core.Data.sourceManager.IsModelExist (mId))
		{
			if(!CradSystemFx.GetInstance().mIsChoose)
			{
				if(!mLockClick)
				{
					if(OneTime)
					{
						return;
					}
				}
				UIDownModel.OpenDownLoadUI (mId, DownLoadFinish, PlayCardAnim, UIDownModel.WinType.WT_Two);
			}
		}
		else
		{
			DownLoadFinish (null);
		}
#else
		DownLoadFinish (null);
#endif
	}
 public static void CloesWin()
 {
     if (mInstance != null)
     {
         Destroy(mInstance.gameObject);
         _instance = null;
     }
 }
 public void Destroy()
 {
     if (mInstance != null)
     {
         Destroy(this.gameObject);
         _mInstance = null;
         UIDownModel.CloesWin();
     }
 }
Exemple #7
0
 void OnClick()
 {
     if (_ItemOfReward.getCurType() == ConfigDataType.Monster)
     {
         if (CradSystemFx.GetInstance().m_UIEggCellIntroduct != null)
         {
             CradSystemFx.GetInstance().m_UIEggCellIntroduct.dealloc();
         }
                     #if SPLIT_MODEL
         if (!Core.Data.sourceManager.IsModelExist(mId))
         {
             if (!CradSystemFx.GetInstance().mIsChoose)
             {
                 UIDownModel.OpenDownLoadUI(mId, DownLoadFinish, null, UIDownModel.WinType.WT_Two);
             }
         }
         else
         {
             DownLoadFinish(null);
         }
                     #else
         DownLoadFinish(null);
                     #endif
     }
     else
     {
         if (!CradSystemFx.GetInstance().mIsChoose)
         {
             if (CradSystemFx.GetInstance().m_UIEggCellIntroduct == null)
             {
                 CradSystemFx.GetInstance().InitHeadIntroduce(_ItemOfReward, new Vector3(mLocalPos.x, mLocalPos.y + 60, mLocalPos.z));
             }
             else
             {
                 CradSystemFx.GetInstance().SetIntroductTrue(_ItemOfReward, new Vector3(mLocalPos.x, mLocalPos.y + 60, mLocalPos.z));
             }
         }
     }
 }
    public static UIDownModel CreateWin(WinType type)
    {
        UObj obj = null;

        switch (type)
        {
        case WinType.WT_One:
            obj = PrefabLoader.loadFromPack("UIDownloadPacks/UIDownModel");
            break;

        case WinType.WT_Two:
            obj = PrefabLoader.loadFromPack("UIDownloadPacks/UIDownMusha");
            break;
        }
        if (obj != null)
        {
            GameObject  go    = Instantiate(obj) as GameObject;
            UIDownModel uiDpw = go.GetComponent <UIDownModel>();
            return(uiDpw);
        }
        return(null);
    }
    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);
    }
    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;
        }
    }