Esempio n. 1
0
    /*创建CityFloor所有元素
     * */
    public void ShowCityFloorView(Chapter _chapter, GameObject root)
    {
        if (Core.Data.temper != null && Core.Data.playerManager.Lv > Core.Data.temper.mPreLevel)
        {
            LevelUpUI.OpenUI();
            Core.Data.temper.mPreLevel = Core.Data.playerManager.Lv;
            Core.Data.temper.mPreVipLv = Core.Data.playerManager.curVipLv;
        }

        if (cityFloorManager == null)
        {
#if FB2
            //FhjLoadPrefab.GetPrefab("pbUICityFloorManager2")
            cityFloorManager = (UnityEngine.Object.Instantiate(FhjLoadPrefab.GetPrefab("pbUICityFloorManager2")) as GameObject).GetComponent <UICityFloorManager>();
#else
            cityFloorManager = FhjLoadPrefab.GetPrefabClass <UICityFloorManager>();
#endif
            cityFloorManager.OnClickedCityItem  = ClickCityItem;
            cityFloorManager.OnClickedFloorItem = ClickFloorItem;
            cityFloorManager.onBossDesInfoClick = ClickBossDesInfo;
            Transform t = cityFloorManager.transform;
            t.parent        = root.transform;
            t.localPosition = Vector3.back * 10;
            t.localRotation = Quaternion.identity;
            t.localScale    = Vector3.one;
        }

        DungeonsManager dm = Core.Data.dungeonsManager;
        chapter = _chapter;
        if (chapter != null)
        {
            citys = new List <City>();
            foreach (int cityId in chapter.config.cityID)
            {
                citys.Add(dm.CityList[cityId]);
            }
        }
        cityFloorManager.UpdateChapterName(chapter.config.name);
        cityFloorManager.InitCityItems(_chapter.config.cityID);


        if (chapter.toFightCity != null)
        {
            SelectCity(chapter.toFightCity);
        }
        else
        {
            SelectCity(dm.CityList[chapter.toFightCityId]);
        }

        UpdateCityItemsState();
        UpdateFloorItemsState();
    }
    public void InitCityItems(int[] citys)
    {
        if (citys != null && citys.Length > 0)
        {
            if (cityItem == null)
            {
                cityItem = FhjLoadPrefab.GetPrefab(FhjPrefabsName.UICityItem);
            }

            DungeonsManager dm    = Core.Data.dungeonsManager;
            int             index = 0;
            foreach (int cityId in citys)
            {
                City itemData = dm.CityList[cityId];

                if (itemData != null)
                {
                    UICityItem _item = null;
                    if (cityList.Count > index)
                    {
                        _item = cityList[index];
                        _item.gameObject.SetActive(true);
                    }
                    else
                    {
                        _item = NGUITools.AddChild(cityRoot.gameObject, cityItem).GetComponent <UICityItem>();
                        _item.gameObject.name = _item.gameObject.name.Substring(0, _item.gameObject.name.IndexOf("(")) + ((char)(index + 'A')).ToString();
                        cityList.Add(_item);
                    }

                    if (_item != null)
                    {
                        _item.InitItem(itemData);
                        _item.OnClickedItem = ClickCityItem;
                        ++index;
                    }
#if FB2
                    _item.SetImage(itemData.config.ID);
#endif
                }
            }

            for (int i = index; i < cityList.Count; ++i)
            {
                cityList[i].gameObject.SetActive(false);
            }
            cityRoot.repositionNow = true;
            _cityScroll.ResetPosition();
        }
    }
    public void ShowReward(BattleSequence data, System.Action callBack)
    {
        UIFloorReward fr = FhjLoadPrefab.GetPrefabClass <UIFloorReward>();

        if (fr != null)
        {
            Transform t = fr.transform;
            t.parent        = transform;
            t.localPosition = Vector3.back;
            t.localRotation = Quaternion.identity;
            t.localScale    = Vector3.one;
            fr.Close        = callBack;
            fr.ShowReward(data);
        }
    }
Esempio n. 4
0
    void SetPet(List <int[]> boss)
    {
        int count = grid.transform.childCount;

        for (int i = 0; i < count; ++i)
        {
            DestroyImmediate(grid.transform.GetChild(0).gameObject);
        }
        foreach (int[] item in boss)
        {
            UIHeadItem hi = FhjLoadPrefab.GetPrefabClass <UIHeadItem>();
            if (hi != null)
            {
                hi.HeadID               = (((item[0] % 2) == 0)?10104:10140);
                hi.transform.parent     = grid.transform;
                hi.transform.localScale = Vector3.one;
            }
        }
        grid.repositionNow = true;
    }
Esempio n. 5
0
    void SetItem()
    {
        TemporyData temp = Core.Data.temper;

        List <BanBattleRole> atksidelist = BanBattleManager.Instance.GetRoleList(BanBattleRole.Group.Attack);

        List <BanBattleRole> defsidelist = BanBattleManager.Instance.GetRoleList(BanBattleRole.Group.Defense);

        NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor;
        bool     side  = false;

        if (floor != null)
        {
            side = floor.config.FightType == 0;
        }

        int itemNum = atksidelist.Count > defsidelist.Count ? atksidelist.Count : defsidelist.Count;

        RED.RemoveChildsImmediate(_grid.transform);
        for (int i = 0; i < itemNum; ++i)
        {
            GameObject     pbitem = FhjLoadPrefab.GetPrefab(_prefabItem);
            UIConflictItem item   = NGUITools.AddChild(_grid.gameObject, pbitem).GetComponent <UIConflictItem>();
            item.gameObject.name = "item" + i;
            if (atksidelist.Count > i)
            {
                if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
                {
                    item._atkPart.SetData(atksidelist [i], side);
                }
                else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
                {
                    item._atkPart.SetData(atksidelist [i], false);
                }
                else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo)
                {
                    bool att = temp.PvpVideo_AttackOrDefense == 1;
                    item._atkPart.SetData(atksidelist [i], att);
                }
                else
                {
                    item._atkPart.SetData(atksidelist [i], true);
                }
            }
            else
            {
                item._atkPart.gameObject.SetActive(false);
            }

            if (defsidelist.Count > i)
            {
                if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
                {
                    item._defPart.SetData(defsidelist [i], !side);
                }
                else if (temp.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
                {
                    item._defPart.SetData(defsidelist [i], true);
                }
                else if (temp.currentBattleType == TemporyData.BattleType.PVPVideo)
                {
                    bool def = temp.PvpVideo_AttackOrDefense == 1;
                    item._defPart.SetData(defsidelist [i], !def);
                }
                else
                {
                    item._defPart.SetData(defsidelist [i], false);
                }
            }
            else
            {
                item._defPart.gameObject.SetActive(false);
            }
        }
        _grid.Reposition();
    }
    public void InitFloorItems(IEnumerable <Floor> list, int floorID)
    {
        if (list != null)
        {
            if (floorItem == null)
            {
                floorItem = FhjLoadPrefab.GetPrefab(FhjPrefabsName.UIFloorItem);
            }
            if (bossItem == null)
            {
                bossItem = NGUITools.AddChild(floorRoot.gameObject, FhjLoadPrefab.GetPrefab(FhjPrefabsName.UIFloorBossItem)).GetComponent <UIFloorBossItem>();
                bossItem.gameObject.name = "z" + bossItem.gameObject.name;
                bossItem.OnClickedItem   = ClickFloorItem;
                bossItem.OnClickedReward = ClickFloorReward;
                bossItem.OnOpenContent   = ShowFloor;
                bossItem.OnLookDesInfo   = ShowDesInfo;
            }

            int index = 0;
            foreach (Floor itemData in list)
            {
                if (itemData != null)
                {
                    UIFloorItem _item  = null;
                    bool        isBoos = itemData.config.isBoss > 0;
                    if (isBoos)
                    {
                        _item = bossItem;
                    }
                    else
                    {
                        if (floorList.Count > index)
                        {
                            _item = floorList[index];
                            _item.gameObject.SetActive(true);
                        }
                        else
                        {
                            _item = NGUITools.AddChild(floorRoot.gameObject, floorItem).GetComponent <UIFloorItem>();
                            _item.OnClickedItem   = ClickFloorItem;
                            _item.OnOpenContent   = ShowFloor;
                            _item.OnLookDesInfo  += ShowDesInfo;
                            _item.gameObject.name = _item.gameObject.name.Substring(0, _item.gameObject.name.IndexOf("(")) + ((char)(index + 'A')).ToString();
                            floorList.Add(_item);
                        }
                    }
                    if (_item != null)
                    {
                        _item.InitItem(itemData, ++index);
                        _item.FoldContent(true);
                        if (itemData.config.ID == floorID)
                        {
                            //                           jump = true;
                            jumpFloorIndex = index - 1;
                        }
                    }
                }
            }

            for (int i = index - 1; i < floorList.Count; ++i)
            {
                floorList[i].gameObject.SetActive(false);
            }
            floorRoot.repositionNow = true;
            _floorScroll.ResetPosition();
            StartCoroutine(NextFrame());
        }
    }
Esempio n. 7
0
    public void ShowCalculate_Is()
    {
        TemporyData tempData = Core.Data.temper;

        //已经清算了。
        tempData.hasLiquidate = true;
        isReplay = true;
        BanBattleProcess.Instance.HandleItemEnd();
        int Teamdef = 0;

        if (mReward == null && _replay == false)
        {
            mReward = FhjLoadPrefab.GetPrefabClass <UIBossReward>();
            if (mReward != null)
            {
                Transform t = mReward.transform;
                t.parent         = go_WinOrLosePos.transform;
                t.localPosition  = Vector3.back;
                t.localRotation  = Quaternion.identity;
                t.localScale     = Vector3.one;
                mReward.OnReplay = Replay;                // 重播按钮

                if (!battleWin)
                {
                    mReward.getRewardLab.gameObject.SetActive(false); // 失败的时候 去点 获得战利品 字符串
                    mReward.FailRewardPosi();
                    //tempData.currentBattleType == TemporyData.BattleType.QiangDuoGoldBattle
                }

                if (tempData.currentBattleType == TemporyData.BattleType.BossBattle)
                {
                    ///
                    /// 新手引导
                    ///
                    if (Core.Data.guideManger.isGuiding)
                    {
                        //UIGuide.Instance.DelayAutoRun(0.3F);
                        AsyncTask.QueueOnMainThread(() => { Core.Data.guideManger.AutoRUN(); }, 0.3f);
                    }

                    Teamdef = mReward.getBattleRightTeamDef();

                    if (battleWin)
                    {
                        if (tempData.warBattle.comboReward != null)
                        {
                            mReward.SetCombe(tempData.FingerTotalCombo.ToString(), tempData.warBattle.comboReward.award.ToString());
                        }
                        mReward.Show(battleWin, tempData.warBattle.reward, Teamdef);
                    }
                    else
                    {
                        mReward.Show(battleWin, null, Teamdef);
                    }
                }
                else if (tempData.currentBattleType == TemporyData.BattleType.TianXiaDiYiBattle ||
                         tempData.currentBattleType == TemporyData.BattleType.QiangDuoGoldBattle ||
                         tempData.currentBattleType == TemporyData.BattleType.SuDiBattle ||
                         tempData.currentBattleType == TemporyData.BattleType.QiangDuoDragonBallBattle ||
                         tempData.currentBattleType == TemporyData.BattleType.Revenge)
                {
                    ///
                    /// 新手引导
                    ///
                    if (Core.Data.guideManger.isGuiding)
                    {
                        Core.Data.guideManger.DelayAutoRun(0.3F);
                    }

                    mReward.Show(battleWin, tempData.warBattle.ext, tempData.warBattle.reward, tempData.warBattle.battleData.df);
                    Core.Data.AccountMgr.SetBattleResult(battleWin);
                }
                else if (tempData.currentBattleType == TemporyData.BattleType.FinalTrialBuou ||
                         tempData.currentBattleType == TemporyData.BattleType.FinalTrialShalu)
                {
                    if (battleWin)
                    {
                        if (tempData.warBattle.reward != null)
                        {
                            mReward.SetCombe(tempData.FingerTotalCombo.ToString(), tempData.warBattle.reward.eco.ToString());
                        }
                        else
                        {
                            mReward.SetCombe(tempData.FingerTotalCombo.ToString(), "0");
                        }
                    }
                    //battleWin = tempData.pass == 1;
                    if (tempData.currentBattleType == TemporyData.BattleType.FinalTrialBuou)
                    {
                        mReward.Show(battleWin, 0);
                    }
                    else
                    {
                        mReward.Show(battleWin, 1);
                    }
                }
                else if (tempData.currentBattleType == TemporyData.BattleType.PVPVideo)
                {
                    int  att           = tempData.PvpVideo_Self_Attack;
                    int  def           = tempData.PvpVideo_Enemy_Defend;
                    int  enemyLv       = tempData.PvpVideo_Enemy_Lv;
                    int  selfLv        = tempData.PvpVideo_Self_Lv;
                    int  whichside     = tempData.PvpVideo_AttackOrDefense;
                    int  PvpVideo_IWin = tempData.PvpVideo_SelfWin;
                    bool MyBussiness   = tempData.isMyBussiness;
                    battleWin = PvpVideo_IWin == 1;
                    mReward.ShowVideo(battleWin, att, def, selfLv, enemyLv, whichside, MyBussiness);
                }
                else if (tempData.currentBattleType == TemporyData.BattleType.WorldBossWar)
                {
                    // Debug.Log("世界boss");
                    //世界boss
                    battleWin = tempData.warBattle.battleData.iswin == 1;
                    mReward.Show(battleWin);
                }
            }
        }
        skipBtn.setEnableBtn(true);
        //展示礼花
        if (battleWin)
        {
            DragonAoYiAnim.ShowFirework();
        }
        ShowReward(true);
        _replay = false;
    }