Exemple #1
0
        public void Receive()
        {
            switch (AlliancesManager.Instance.DartData.State)
            {
            case eAllianceDartCurrentState.None:
            case eAllianceDartCurrentState.Robing:
            case eAllianceDartCurrentState.Rob:
                //非活动时间内接取运镖任务时提示:当前不在活动时间,不能接受运镖任务。
                if (AllianceEscortUtil.GetResidueTransferDartNum() > 0)
                {
                    var selected = GetSelectedDart();
                    AlliancesManager.Instance.DartData.CurrentDartId = selected.Id;
                    StartTransfer(selected);
                }
                else
                {
                    MessageTemplateManager.ShowMessage(902072);
                }
                break;

            case eAllianceDartCurrentState.Transfer:
            case eAllianceDartCurrentState.Transfering:
                //运镖期间不能再领取运镖任务
                MessageTemplateManager.ShowMessage(902071);
                break;
            }
        }
Exemple #2
0
        public void OnTransferDartRefreshBtnClick()
        {
            //var dartData = AlliancesManager.Instance.DartData;
            //if (dartData.State == eAllianceDartCurrentState.Transfer || dartData.State == eAllianceDartCurrentState.Transfering)
            //{
            //	return;
            //}

            if (mRotating)
            {
                return;
            }

            if (AllianceEscortUtil.GetResidueTransferDartNum() <= 0)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_8870"));
                return;
            }

            var cur = AlliancesManager.Instance.TransferDartInfo.GetCurrentSelectDart();

            if (AllianceEscortUtil.GetResidueTransferRefreshNum() > 0 || mTicketNum > 0)
            {
                if (cur != null && cur.DartName.CompareTo("tian") == 0)
                {
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_9174"), null);
                    return;
                }

                mIsRefresh = true;
                //LTUIUtil.SetGreyButtonEnable(controller.CoolTriggers["TransferDartRefreshBtn"], false);
                controller.CoolTriggers["TransferDartRefreshBtn"].GetComponent <UISprite>().color = new Color(1, 0, 1, 1);
                LTUIUtil.SetGreyButtonEnable(controller.UiButtons["StartTransferBtn"], false);
                AlliancesManager.Instance.Refresh();
            }
            else
            {
                if (BalanceResourceUtil.GetUserDiamond() >= refreshCostHC)
                {
                    if (cur != null && cur.DartName.CompareTo("tian") == 0)
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_9174"), null);
                        return;
                    }

                    mIsRefresh = true;
                    //LTUIUtil.SetGreyButtonEnable(controller.CoolTriggers["TransferDartRefreshBtn"], false);
                    controller.CoolTriggers["TransferDartRefreshBtn"].GetComponent <UISprite>().color = new Color(1, 0, 1, 1);
                    LTUIUtil.SetGreyButtonEnable(controller.UiButtons["StartTransferBtn"], false);
                    AlliancesManager.Instance.Refresh();
                }
                else
                {
                    BalanceResourceUtil.HcLessMessage();
                }
            }
        }
Exemple #3
0
        private void OnInfoListener(string path, INodeData data)
        {
            AllianceEscortUtil.FormatResidueRobDartNum(ResidueRobNumLabel);

            int    residueTransferNum = AllianceEscortUtil.GetResidueTransferDartNum();
            string colorStr           = residueTransferNum > 0 ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            LTUIUtil.SetText(ResidueTransferDartNumLabel, string.Format(EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_2955"), colorStr, residueTransferNum));

            LTUIUtil.SetText(TransferDartTimeLabel, Hotfix_LT.Data.EventTemplateManager.Instance.GetActivityOpenTimeStr("escort_start", "escort_stop"));
        }
Exemple #4
0
 public void Fill(RobDartMember data)
 {
     mItemData = data;
     LTUIUtil.SetText(DartNameLabel, AllianceEscortUtil.LocalizeDartName(data.DartName));
     DartQualityBG.spriteName = AllianceEscortUtil.GetDartQualityBGSpriteName(data.DartName);
     PlayerLevelLabel.text    = data.PlayerLevel.ToString();
     HeroPortrait.spriteName  = data.Portrait;
     FramePortrait.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(data.HeadFrame).iconId;
     RewardItem1.LTItemData   = data.Award[0];
     RewardItem2.LTItemData   = data.Award[1];
     Container.CustomSetActive(true);
 }
Exemple #5
0
        private void OnInfoListener(string path, INodeData data)
        {
            int    residueTransferNum = AllianceEscortUtil.GetResidueTransferDartNum();
            string colorStr           = residueTransferNum > 0 ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            LTUIUtil.SetText(controller.UiLabels["ResidueTransferDartNumLabel"], string.Format(EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_2955"), colorStr, residueTransferNum));

            int    residueRobNum = AllianceEscortUtil.GetResidueRobDartNum();
            string cs            = residueRobNum > 0 ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            LTUIUtil.SetText(controller.UiLabels["ResidueRobNumLabel"], string.Format(EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_3223"), cs, residueRobNum));

            RefreshBtnState();
        }
Exemple #6
0
        public void OnStartTransferBtnClick()
        {
            if (mIsRefresh || mRotating)
            {
                return;
            }

            FusionAudio.PostEvent("UI/General/ButtonClick");
            if (!AllianceEscortUtil.IsMeetTransferCondition())
            {
                return;
            }

            Receive();
        }
Exemple #7
0
        public override void OnLookupUpdate(string dataID, object value)
        {
            base.OnLookupUpdate(dataID, value);

            string[] dataIdSps = dataID.Split('.');
            if (dataIdSps[dataIdSps.Length - 1] == "tid")
            {
                string tid  = value as string;
                int    skin = 0;
                DataLookupsCache.Instance.SearchDataByID <int>(dataID.Replace(".tid", ".skin"), out skin);
                if ((tid != ModelTid || skin != Skin) && !AllianceUtil.IsInTransferDart)
                {
                    if (!string.IsNullOrEmpty(tid))
                    {
                        mDL.transform.GetMonoILRComponent <Player.PlayerHotfixController>().ChangeLeaderModel(tid, skin);
                    }
                    else
                    {
                        EB.Debug.LogError("OtherPlayerTidDataLookup Error: tid NUll ModelTid={0}", ModelTid);
                    }
                }
                ModelTid = tid;
                Skin     = skin;
            }
            else if (dataIdSps[dataIdSps.Length - 1] == "TOR")
            {
                eDartState dartState = (eDartState)System.Convert.ToInt32(value);

                float scale_size = 1f;
                if (dartState != DartState)
                {
                    if (AllianceEscortUtil.GetIsInTransferDart(dartState))
                    {
                        string dartName  = dartState.ToString();
                        string modelName = AllianceEscortUtil.GetTransportCartModel(AllianceEscortUtil.ToDartStateStr(dartState));
                        scale_size = (modelName.IndexOf("M1003") >= 0 || modelName.IndexOf("M1004") >= 0) ? 0.6f : 1;
                        mDL.transform.GetMonoILRComponent <Player.PlayerHotfixController>().ChangeModel(modelName, false, scale_size);
                    }
                    else
                    {
                        int skin = 0;
                        DataLookupsCache.Instance.SearchIntByID(dataID.Replace(".tid", ".skin"), out skin);
                        mDL.transform.GetMonoILRComponent <Player.PlayerHotfixController>().ChangeLeaderModel(ModelTid, skin);
                    }
                }
                DartState = dartState;
            }
        }
Exemple #8
0
        public void OnRobClick(RobDartItem data)
        {
            if (clickLimit)
            {
                EB.Debug.Log("OnRobClick °´Å¥CDÖÐÀ¹½ØÂß¼­Î´Ö´ÐÐ");
                return;
            }
            EB.Debug.Log("OnRobClick Ö´ÐоüÍÅÀ¹½ØÂß¼­");
            clickLimit = true;
            RegisterMonoUpdater();
            if (!AllianceEscortUtil.IsMeetRobCondition())
            {
                return;
            }
            var mItemData = data.GetItemData();

            switch (AlliancesManager.Instance.DartData.State)
            {
            case eAllianceDartCurrentState.Transfer:
            case eAllianceDartCurrentState.Transfering:
                var ht = Johny.HashtablePool.Claim();
                ht.Add("0", EB.Localizer.GetString("ID_ROB_DART"));
                MessageTemplateManager.ShowMessage(902053, ht, null);
                break;

            case eAllianceDartCurrentState.None:
            case eAllianceDartCurrentState.Robing:
            case eAllianceDartCurrentState.Rob:
                AlliancesManager.Instance.RobDartInfo.RobAwards = mItemData.Award;
                AlliancesManager.Instance.Rob(mItemData.Uid, mItemData.DartId, delegate(Hashtable result)
                {
                    if (result != null)
                    {
                        GlobalMenuManager.Instance.CloseMenu("LTAllianceEscortHud");
                        string targetSceneName = EB.Dot.String("escortAndRob.robDart.info.targetSceneName", result, string.Empty);
                        string strPos          = EB.Dot.String("escortAndRob.robDart.info.pos", result, string.Empty);
                        Vector3 to_pos         = GM.LitJsonExtension.ImportVector3(strPos);
                        Vector3 from_pos       = new Vector3(25.0f, 0.0f, 45.0f);

                        //SceneLogic.Transfer_RobDart(MainLandLogic.GetInstance().CurrentSceneName, from_pos, 90.0f, targetSceneName, to_pos, 90.0f, mItemData.Uid, mItemData.DartId);
                        //AlliancesManager.Instance.Fight(mItemData.Uid, mItemData.DartId);
                        AlliancesManager.Instance.RobFight(mItemData.Uid, mItemData.DartId);
                    }
                });
                break;
            }
        }
Exemple #9
0
        private void SetTransferDartResidueRefreshCount()
        {
            if (AlliancesManager.Instance.TransferDartInfo.Members.Count <= 0)
            {
                EB.Debug.LogError("TransferDartInfo not init");
                return;
            }

            int residueFreeRefreshNum = AllianceEscortUtil.GetResidueTransferRefreshNum();

            if (residueFreeRefreshNum < 0)
            {
                EB.Debug.LogError("residueFreeRefreshNum < 0 num={0}", residueFreeRefreshNum);
                residueFreeRefreshNum = 0;
            }
            //int totalFreeRefreshNum = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.EscortRefreshTimes);

            if (residueFreeRefreshNum > 0)
            {
                LTUIUtil.SetText(controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"], residueFreeRefreshNum.ToString());
            }
            else
            {
                mTicketNum = GameItemUtil.GetInventoryItemNum(Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("escortRefreshItem").ToString());
                if (mTicketNum > 0)
                {
                    LTUIUtil.SetText(controller.UiLabels["TransferDartRefreshTicketNumLabel"], mTicketNum.ToString());
                    controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(true);
                    controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false);
                    controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(false);
                }
                else
                {
                    controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(false);
                    controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false);
                    controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(true);
                    if (BalanceResourceUtil.GetUserDiamond() >= refreshCostHC)
                    {
                        controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.GreenColor;
                    }
                    else
                    {
                        controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.RedColor;
                    }
                }
            }
        }
Exemple #10
0
        public void OnContinueBtnClick()
        {
            FusionAudio.PostEvent("UI/General/ButtonClick");
            switch (sResultType)
            {
            case eDartResultType.TransferSuccess:
            case eDartResultType.TransferFail:
            case eDartResultType.TransferFailByTimeout:
            {
                AllianceEscortUtil.GotoTranferDart();
            }
            break;

            case eDartResultType.RobSuccess:
            case eDartResultType.RobFail:
            {
                AllianceEscortUtil.GotoRobDart();
            }
            break;
            }
            controller.Close();
        }
Exemple #11
0
        void PushCache(eCombatOutcome outcome)
        {
            switch (SceneLogic.BattleType)
            {
            case eBattleType.LadderBattle:
                GlobalMenuManager.Instance.PushCache("LadderUI");
                break;

            case eBattleType.ArenaBattle:
                GlobalMenuManager.Instance.PushCache("ArenaHudUI");
                break;

            case eBattleType.HonorArena:
                GlobalMenuManager.Instance.PushCache("HonorArenaHudUI");
                break;

            case eBattleType.HantBattle:
                if (!LTBountyTaskConversationController.sRunAway && LTBountyTaskHudController.HantTimes < LTBountyTaskHudController.TotalHantTimes)
                {
                    GlobalMenuManager.Instance.PushCache("LTBountyTaskOverUI");
                }
                LTBountyTaskConversationController.sRunAway = false;
                if (outcome == eCombatOutcome.Win)
                {
                    FusionTelemetry.GamePlayData.PostEvent(FusionTelemetry.GamePlayData.bounty_topic,
                                                           FusionTelemetry.GamePlayData.bounty_event_id, FusionTelemetry.GamePlayData.bounty_umengId, "reward");
                }
                break;

            case eBattleType.TransferOrRob:
                if (outcome == eCombatOutcome.Win)
                {
                    if (AlliancesManager.Instance.DartData.State == eAllianceDartCurrentState.Rob)
                    {
                        AlliancesManager.Instance.DartData.State = eAllianceDartCurrentState.None;
                        if (AlliancesManager.Instance.RobDartInfo.RobAwards != null)
                        {
                            var list = new List <LTShowItemData>();

                            for (var i = 0; i < AlliancesManager.Instance.RobDartInfo.RobAwards.Count; i++)
                            {
                                var item = AlliancesManager.Instance.RobDartInfo.RobAwards[i];
                                list.Add(new LTShowItemData(item.id, item.count, item.type, false));
                            }

                            DartResultController.sRewardDataList = list;
                            AllianceEscortUtil.SetEscortResultHudCache(eDartResultType.RobSuccess);
                            FusionTelemetry.GamePlayData.PostEsortEvent("reward", "rob");
                        }
                        else
                        {
                            EB.Debug.LogError("rob dart success but award = null");
                        }
                    }
                }
                else
                {
                    if (AlliancesManager.Instance.DartData.State == eAllianceDartCurrentState.Rob)
                    {
                        AllianceEscortUtil.SetEscortResultHudCache(eDartResultType.RobFail);
                    }
                }
                break;

            case eBattleType.HeroBattle:
                GlobalMenuManager.Instance.PushCache("LTHeroBattleMatch");
                break;

            case eBattleType.NationBattle:
                NationBattleHudController.IsContinueWalk = outcome == eCombatOutcome.Win;
                int cityId = 0;
                DataLookupsCache.Instance.SearchIntByID("combat.cityId", out cityId);
                GlobalMenuManager.Instance.PushCache("LTNationBattleEntryUI", cityId);
                break;

            case eBattleType.AwakeningBattle:
            {
                if (!GlobalMenuManager.Instance.IsContain("LTAwakeningInstanceHud"))
                {
                    GlobalMenuManager.Instance.PushCache("LTInstanceMapHud");
                    GlobalMenuManager.Instance.PushCache("LTAwakeningInstanceHud");
                }
            }; break;

            case eBattleType.SleepTower:
            {
                if (!GlobalMenuManager.Instance.IsContain("LTClimbingTowerHud"))
                {
                    GlobalMenuManager.Instance.PushCache("LTInstanceMapHud");
                    GlobalMenuManager.Instance.PushCache("LTClimbingTowerHud");
                }
            }; break;

            case eBattleType.ExpSpringBattle:
            {
                if (!GlobalMenuManager.Instance.IsContain("LTResourceInstanceUI"))
                {
                    GlobalMenuManager.Instance.PushCache("LTInstanceMapHud");
                    GlobalMenuManager.Instance.PushCache("LTResourceInstanceUI", "Exp");
                }
            }; break;

            case eBattleType.TreasuryBattle:
            {
                if (!GlobalMenuManager.Instance.IsContain("LTResourceInstanceUI"))
                {
                    GlobalMenuManager.Instance.PushCache("LTInstanceMapHud");
                    GlobalMenuManager.Instance.PushCache("LTResourceInstanceUI", "Gold");
                }
            }; break;

            case eBattleType.InfiniteChallenge:
                if (!GlobalMenuManager.Instance.IsContain("LTUltimateTrialHud"))
                {
                    GlobalMenuManager.Instance.PushCache("LTUltimateTrialHud");
                }
                break;
            }
        }
Exemple #12
0
        public int GetActivityCount(int activityID)//仅用于活动是否需要提示以及日常界面显示,部分活动次数不准确
        {
            Hotfix_LT.Data.SpecialActivityTemplate curAct = Hotfix_LT.Data.EventTemplateManager.Instance.GetSpecialActivity(activityID);

            if (curAct == null)
            {
                return(0);
            }

            if (activityID == 9001 || activityID == 9002 || activityID == 9007)
            {
                //经验副本,金币副本,夺宝奇兵
                int    times = 0;
                string path  = string.Format("special_activity.{0}.c_times", activityID);
                DataLookupsCache.Instance.SearchDataByID(path, out times);
                return(curAct.times - times);
            }
            else if (activityID == 9003)
            {
                DataLookupsCache.Instance.SearchDataByID("world_boss.fightTimes", out int ChallengeTime);
                DataLookupsCache.Instance.SearchDataByID("world_boss.buyTimes", out int BuyTimes);
                int Maxtime = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("worldBossChallengeMaxTimes");
                return(Maxtime + BuyTimes - ChallengeTime);
            }
            else if (activityID == 9004)
            {//军团战
                //EB.Debug.LogError("军团战数据获取");
                if (!LTLegionWarManager.Instance.IsOpenWarTime())
                {
                    return(0);
                }
                LegionWarTimeLine status = LTLegionWarManager.GetLegionWarStatus();
                if (status == LegionWarTimeLine.QualifyGame)
                {
                    if (!AllianceUtil.IsJoinedAlliance)
                    {
                        return(1);
                    }
                    int myScore = LTLegionWarManager.Instance.QualifyEnemyList.MyScore;
                    return(myScore >= LTLegionWarManager.Instance.MaxScore ? 0 : 1);
                }
                else if (status == LegionWarTimeLine.SemiFinal)
                {
                    return(1);
                }
                else if (status == LegionWarTimeLine.Final)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            else if (activityID == 9005)
            {
                //军团护送
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueTransferDartNum());
            }
            else if (activityID == 9006)
            {
                //军团拦截
                if (AlliancesManager.Instance.Account.State != eAllianceState.Joined)
                {
                    return(curAct.times + GetVIPAdditionTimes(activityID));
                }
                return(AllianceEscortUtil.GetResidueRobDartNum());
            }
            else if (activityID == 9009)
            {
                //极限试炼
                int dayDisCountTime = 0;
                int oldVigor        = 0;
                int NewVigor        = 0;
                int times           = LTUltimateTrialDataManager.Instance.GetCurrencyTimes();
                NewGameConfigTemplateManager.Instance.GetEnterVigor(eBattleType.InfiniteChallenge, out dayDisCountTime, out NewVigor, out oldVigor);
                int curDisCountTime = dayDisCountTime - times;
                return(Mathf.Max(0, curDisCountTime));
                //if (!DataLookupsCache.Instance.SearchIntByID("infiniteChallenge.info.challengeTimes", out times))
                //{
                //    times = curAct.times;
                //}
                //return Mathf.Max(0, times + GetVIPAdditionTimes(activityID));
            }
            else if (activityID == 9010)
            {//天梯
                LTDailyData tempdailydata = GetDailyDataByActivityID(9010);
                if (tempdailydata == null)
                {
                    return(0);
                }
                else
                {
                    return(tempdailydata.OpenTimeValue < LTDailyDataManager.TimeNow && tempdailydata.StopTimeValue > LTDailyDataManager.TimeNow ? 1 : 0);
                }
            }
            else if (activityID == 9011)
            {//英雄交锋
                //今天赢了或者达到最大胜场 0 就不显示红点
                return(LTNewHeroBattleManager.GetInstance().GetHeroBattleTipNum());
            }
            else if (activityID == 9013)
            {
                return(IsCouldReceiveVit()?1:0);
            }
            else if (activityID == 9014)
            {
                //幸运悬赏
                int times = LTBountyTaskHudController.CurHantTimes;
                return(times);
            }
            else if (activityID == 9015)
            {
                //角斗场
                int totalTimes = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.ArenaTimes) + ArenaManager.Instance.Info.buyTimes;
                int times      = Mathf.Max(0, totalTimes - ArenaManager.Instance.Info.usedTimes);
                return(times);
            }
            else if (activityID == 9016)
            {
                //荣耀角斗场
                int freetimes = HonorArenaManager.Instance.GetHonorArenaFreeTimes();
                int usetimes  = HonorArenaManager.Instance.Info.usedTimes;
                return(freetimes - usetimes);
            }
            return(0);
        }
Exemple #13
0
        /// <summary>
        /// from Class SceneLogic
        /// </summary>
        /// <param name="playerSpawnEntry"></param>
        /// <param name="themeLoadMgr"></param>
        /// <param name="pos"></param>
        /// <param name="rot"></param>
        /// <param name="userid"></param>
        public static void CreateOtherPlayer(SceneLogic.PlayerEntry playerSpawnEntry, ThemeLoadManager themeLoadMgr, Vector3 pos, Quaternion rot, long userid)
        {
            try
            {
                if (pos.Equals(Vector3.zero))                //传送都是这个点 都要换算为出生点
                {
                    pos = playerSpawnEntry.position;
                    rot = playerSpawnEntry.rotation;
                }

                //lzt 需要排查原因为什么会得到空
                string     modelName  = BuddyAttributesManager.GetModelClass(userid.ToString());
                float      scale_size = 1f;
                eDartState dartState  = eDartState.None;
                double     fDartState;
                if (!DataLookupsCache.Instance.SearchDataByID <double>(string.Format("mainlands.pl.{0}.state.TOR", userid), out fDartState))
                {
                    EB.Debug.LogError("when intact search data dartState state fail");
                }
                dartState = (eDartState)System.Convert.ToInt32(fDartState);
                if (AllianceEscortUtil.GetIsInTransferDart(dartState))
                {
                    string dartName = dartState.ToString();
                    modelName  = AllianceEscortUtil.GetTransportCartModel(AllianceEscortUtil.ToDartStateStr(dartState));
                    scale_size = (modelName.IndexOf("M1003") >= 0 || modelName.IndexOf("M1004") >= 0) ? 0.6f : 1;
                }
                if (string.IsNullOrEmpty(modelName))
                {
                    EB.Debug.Log("CreateOtherPlayer ModelClassIsNullOrEmpty for userid={0}", userid);
                    return;
                }

                #region Async Load OtherPlayer
                EB.Assets.LoadAsync(RES_OtherPlayer, typeof(GameObject), o =>
                {
                    if (!o)
                    {
                        return;
                    }

                    SceneRootEntry sceneRoot = themeLoadMgr.GetSceneRoot();
                    GameObject localObj      = Replication.Instantiate(o, pos, rot) as GameObject;
                    Transform PlayerList     = sceneRoot.m_SceneRoot.transform.Find("PlayerList");
                    if (PlayerList == null)
                    {
                        GameObject partner = new GameObject("PlayerList");
                        partner.transform.SetParent(sceneRoot.m_SceneRoot.transform);
                        PlayerList = partner.transform;
                    }
                    PlayerList.gameObject.CustomSetActive(true);
                    localObj.transform.SetParent(PlayerList);

                    PlayerController player_controller = localObj.GetComponent <PlayerController>();
                    player_controller.playerUid        = userid;
                    Player.PlayerHotfixController hotfix_controller = player_controller.transform.GetMonoILRComponent <Player.PlayerHotfixController>();
                    hotfix_controller.SetPlayerSpawnLocation(pos);
                    hotfix_controller.CreateOtherPlayer(modelName, userid, scale_size);//创建其他人
                    hotfix_controller.InitDataLookupSet();

                    OtherPlayerTidDataLookup OPTD = player_controller.transform.GetDataLookupILRComponent <OtherPlayerTidDataLookup>(false);
                    if (OPTD == null)
                    {
                        OPTD                = player_controller.gameObject.AddDataLookupILRComponent <OtherPlayerTidDataLookup>("Hotfix_LT.UI.OtherPlayerTidDataLookup");
                        string path         = string.Format("mainlands.pl.{0}.tid", userid);
                        string torStatePath = string.Format("mainlands.pl.{0}.state.TOR", userid);
                        DataLookupsCache.Instance.SearchDataByID <string>(path, out OPTD.ModelTid);
                        OPTD.DartState = dartState;
                        OPTD.mDL.RegisterDataID(path);
                        OPTD.mDL.RegisterDataID(torStatePath);
                        //OPTD.DefaultDataID= path;
                    }
                });
                #endregion
            }
            catch (System.Exception e)
            {
                EB.Debug.LogError("Message: {0}, Stack: {1}", e.Message, e.StackTrace);
                UnityEngine.Debug.LogException(e);
            }
        }
Exemple #14
0
        void InitUIMode()
        {
            List <LTShowItemData> rewardDatas = sRewardDataList;

            BG.CustomSetActive(true);
            BG2.CustomSetActive(false);
            RewardRoot.transform.localPosition = new Vector3(0, RewardRoot.transform.localPosition.y, 0);
            switch (sResultType)
            {
            case eDartResultType.TransferSuccess:
                LTUIUtil.SetText(TitleLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1251"));
                RewardRoot.gameObject.CustomSetActive(true);
                SetReward(rewardDatas);
                FailTipsLabel.gameObject.CustomSetActive(false);
                LTUIUtil.SetText(ResiduePrefixLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1425"));
                AllianceEscortUtil.FormatResidueTransferDartNum(ResidueNumLabel);
                LTUIUtil.SetText(ContinueBtnLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1549"));
                break;

            case eDartResultType.TransferFail:
                BG.CustomSetActive(false);
                BG2.CustomSetActive(true);
                RewardRoot.transform.localPosition = new Vector3(150, RewardRoot.transform.localPosition.y, 0);
                if (InterceptorData != null)
                {
                    var heroInfo = CharacterTemplateManager.Instance.GetHeroInfo(InterceptorData.CharacterId, InterceptorData.Skin);
                    if (heroInfo != null)
                    {
                        m_Icon.spriteName = heroInfo.icon;
                    }
                    m_Frame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(InterceptorData.Frame).iconId;
                }
                else
                {
                    m_Icon.gameObject.CustomSetActive(false);
                }
                LTUIUtil.SetText(TitleLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1643"));
                RewardRoot.gameObject.CustomSetActive(true);
                SetReward(rewardDatas);
                FailTipsLabel.gameObject.CustomSetActive(false);
                LTUIUtil.SetText(ResiduePrefixLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1425"));
                AllianceEscortUtil.FormatResidueTransferDartNum(ResidueNumLabel);
                LTUIUtil.SetText(ContinueBtnLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1549"));
                break;

            case eDartResultType.TransferFailByTimeout:
                LTUIUtil.SetText(TitleLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1643"));
                RewardRoot.gameObject.CustomSetActive(false);
                LTUIUtil.SetText(FailTipsLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2136"));
                FailTipsLabel.gameObject.CustomSetActive(true);
                LTUIUtil.SetText(ResiduePrefixLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1425"));
                AllianceEscortUtil.FormatResidueTransferDartNum(ResidueNumLabel);
                LTUIUtil.SetText(ContinueBtnLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_1549"));
                break;

            case eDartResultType.RobSuccess:
                LTUIUtil.SetText(TitleLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2460"));
                RewardRoot.gameObject.CustomSetActive(true);
                SetReward(rewardDatas);
                AlliancesManager.Instance.RobDartInfo.RobAwards = null;
                FailTipsLabel.gameObject.CustomSetActive(false);
                LTUIUtil.SetText(ResiduePrefixLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2694"));
                AllianceEscortUtil.FormatResidueRobDartNum(ResidueNumLabel);
                LTUIUtil.SetText(ContinueBtnLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2814"));
                break;

            case eDartResultType.RobFail:
                LTUIUtil.SetText(TitleLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2903"));
                RewardRoot.gameObject.CustomSetActive(false);
                LTUIUtil.SetText(FailTipsLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2994"));
                FailTipsLabel.gameObject.CustomSetActive(true);
                LTUIUtil.SetText(ResiduePrefixLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2694"));
                AllianceEscortUtil.FormatResidueRobDartNum(ResidueNumLabel);
                LTUIUtil.SetText(ContinueBtnLabel, EB.Localizer.GetString("ID_codefont_in_DartResultController_2814"));
                break;
            }
        }