Merge remote-tracking branch 'origin/master' into Skill_Polymorph_BeatBackPlayer
| | |
| | | while (!SDKUtility.Instance.AssetCopyFinished)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.5f, progressBuf, progressBuf + 0.5f);
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | yield return null;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | finally
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.5f, progressBuf, progressBuf + 0.5f);
|
| | | progress = Mathf.Clamp(progressBuf + ((float)index / count) * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | }
|
| | |
|
| | | yield return null;
|
| | |
| | | while (!AssetVersionUtility.checkAssetCompleted)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.4f, progressBuf, progressBuf + 0.4f);
|
| | | progress = Mathf.Clamp(progressBuf + timer / duration * 0.3f, progressBuf, progressBuf + 0.3f);
|
| | | yield return null;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | progressBuf = progress;
|
| | | while (!LaunchPostProcess.Instance.completed
|
| | | && LaunchPostProcess.Instance.progress < (Application.platform == RuntimePlatform.WindowsEditor ? 1f : 0.6f))
|
| | | && LaunchPostProcess.Instance.progress < (Application.platform == RuntimePlatform.WindowsEditor ? 1f : 0.8f))
|
| | | {
|
| | | progress = Mathf.Clamp(progressBuf + LaunchPostProcess.Instance.progress * 1.67f, progressBuf, 1f);
|
| | | progress = Mathf.Clamp(progressBuf + LaunchPostProcess.Instance.progress * 1.25f, progressBuf, 1f);
|
| | | yield return null;
|
| | | }
|
| | |
|
| | |
| | | List<AssetVersion> tasks = new List<AssetVersion>();
|
| | |
|
| | | public bool inGameDownLoadAllow = false;
|
| | |
|
| | |
|
| | | |
| | | public float progress {
|
| | | get {
|
| | |
| | | }
|
| | | } |
| | | |
| | | int workingQueueMaxCount = 1; |
| | | |
| | | IEnumerator Co_StartDownLoad()
|
| | | {
|
| | |
| | | workingQueue.Clear();
|
| | | okCount = 0;
|
| | |
|
| | | var downLoadTasksQueues = new Queue<AssetVersion>();
|
| | |
|
| | | for (int i = 0; i < tasks.Count; i++)
|
| | | {
|
| | | var assetVersion = tasks[i];
|
| | | if (!assetVersion.localValid)
|
| | | {
|
| | | var remoteURL = StringUtility.Contact(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), "/", assetVersion.relativePath);
|
| | | var localURL = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
|
| | |
|
| | | var remoteFile = new RemoteFile();
|
| | | workingQueue.Add(remoteFile);
|
| | | remoteFile.Init(remoteURL, localURL, assetVersion, true);
|
| | | remoteFile.Begin(OnFileDownLoadCompleted);
|
| | | downLoadTasksQueues.Enqueue(assetVersion);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | |
|
| | | while (okCount < totalCount)
|
| | | {
|
| | | while (workingQueue.Count < 2 && downLoadTasksQueues.Count > 0)
|
| | | {
|
| | | var assetVersion = downLoadTasksQueues.Dequeue();
|
| | | var remoteURL = StringUtility.Contact(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), "/", assetVersion.relativePath);
|
| | | var localURL = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
|
| | |
|
| | | var remoteFile = new RemoteFile();
|
| | | workingQueue.Add(remoteFile);
|
| | | remoteFile.Init(remoteURL, localURL, assetVersion, true);
|
| | | remoteFile.Begin(OnFileDownLoadCompleted);
|
| | | }
|
| | | yield return null;
|
| | | }
|
| | |
|
| | |
| | | |
| | | private void OnFileDownLoadCompleted(bool _ok, AssetVersion _assetVersion)
|
| | | {
|
| | | foreach (var remote in workingQueue)
|
| | | {
|
| | | if (remote.assetVersion == _assetVersion)
|
| | | {
|
| | | workingQueue.Remove(remote);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_ok)
|
| | | {
|
| | | okCount++;
|
| | |
| | | else if (!InGameDownLoad.Instance.hasReward
|
| | | && InGameDownLoad.Instance.completeDownLoadAccount == PlayerDatas.Instance.baseData.AccID)
|
| | | {
|
| | | m_ProgressText.gameObject.SetActive(false);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | m_ProgressText.text = "100%";
|
| | | this.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | |
| | | break;
|
| | | case InGameDownLoad.State.Award:
|
| | | this.gameObject.SetActive(true);
|
| | | m_ProgressText.gameObject.SetActive(false);
|
| | | m_ProgressText.gameObject.SetActive(true);
|
| | | m_ProgressText.text = "100%";
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | } |
| | | } |
| | | |
| | | AssetVersion assetVersion; |
| | | public AssetVersion assetVersion { get; private set; } |
| | | protected string mRemoteFile; |
| | | protected string localFile; |
| | | bool speedLimit = false; |
| | |
| | | |
| | | public static void Prepare()
|
| | | {
|
| | | gDownloadIsRunningCount = 0;
|
| | | gStartTickcount = System.Environment.TickCount;
|
| | | TotalDownloadedSize = 0L;
|
| | | downloadSpeedRef = 0f;
|
| | |
| | | }
|
| | |
|
| | | stop = true;
|
| | |
|
| | | if (headRequest != null)
|
| | | try
|
| | | {
|
| | | headRequest.Abort();
|
| | | headRequest = null;
|
| | | if (headRequest != null)
|
| | | {
|
| | | headRequest.Abort();
|
| | | headRequest = null;
|
| | | }
|
| | |
|
| | | if (headResponse != null)
|
| | | {
|
| | | headResponse.Close();
|
| | | headResponse = null;
|
| | | }
|
| | |
|
| | | if (fileRequest != null)
|
| | | {
|
| | | fileRequest.Abort();
|
| | | fileRequest = null;
|
| | | }
|
| | |
|
| | | if (fileResponse != null)
|
| | | {
|
| | | fileResponse.Close();
|
| | | fileResponse = null;
|
| | | }
|
| | |
|
| | | if (fs != null)
|
| | | {
|
| | | fs.Flush();
|
| | | fs.Close();
|
| | | fs = null;
|
| | | }
|
| | |
|
| | | if (inStream != null)
|
| | | {
|
| | | inStream.Close();
|
| | | inStream = null;
|
| | | }
|
| | | }
|
| | |
|
| | | if (headResponse != null)
|
| | | catch (Exception ex)
|
| | | {
|
| | | headResponse.Close();
|
| | | headResponse = null;
|
| | | Debug.Log(ex);
|
| | | }
|
| | |
|
| | | if (fileRequest != null)
|
| | | finally
|
| | | {
|
| | | fileRequest.Abort();
|
| | | fileRequest = null;
|
| | | }
|
| | |
|
| | | if (fileResponse != null)
|
| | | {
|
| | | fileResponse.Close();
|
| | | fileResponse = null;
|
| | | }
|
| | |
|
| | | if (fs != null)
|
| | | { |
| | | fs.Flush(); |
| | | fs.Close(); |
| | | fs = null; |
| | | } |
| | | |
| | | if (inStream != null)
|
| | | { |
| | | inStream.Close(); |
| | | inStream = null; |
| | | } |
| | | |
| | | onCompleted = null; |
| | | mHadError = false;
|
| | |
|
| | | if (state == State.Working)
|
| | | {
|
| | | gDownloadIsRunningCount--;
|
| | | onCompleted = null;
|
| | | mHadError = false;
|
| | | if (state == State.Working)
|
| | | {
|
| | | gDownloadIsRunningCount--;
|
| | | }
|
| | | }
|
| | | } |
| | |
|
| | |
| | | headResponse.Close(); |
| | | headResponse = null; |
| | | } |
| | | headRequest.Abort(); |
| | | if (headRequest != null)
|
| | | {
|
| | | headRequest.Abort();
|
| | | headRequest = null;
|
| | | } |
| | | } |
| | | |
| | | }, headRequest); |
| | |
| | | if (mHadError)
|
| | | { |
| | | DebugEx.LogWarningFormat("获取远程文件{0} 信息失败!", mRemoteFile); |
| | | headRequest.Abort(); |
| | | if (headRequest != null)
|
| | | {
|
| | | headRequest.Abort();
|
| | | headRequest = null;
|
| | | } |
| | | |
| | | done = true; |
| | | gDownloadIsRunningCount--; |
| | | yield break; |
| | |
| | | |
| | | void ReadDataCallback(IAsyncResult ar)
|
| | | { |
| | | if (stop)
|
| | | {
|
| | | return;
|
| | | } |
| | | |
| | | try
|
| | | { |
| | | if (inStream != null)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | fs.Close();
|
| | | fs = null;
|
| | | inStream.Close();
|
| | | inStream = null;
|
| | | fileResponse.Close();
|
| | | fileResponse = null;
|
| | | if (fs != null)
|
| | | {
|
| | | fs.Close();
|
| | | fs = null;
|
| | | }
|
| | |
|
| | | if (inStream != null)
|
| | | {
|
| | | inStream.Close();
|
| | | inStream = null;
|
| | | }
|
| | |
|
| | | if (fileResponse != null)
|
| | | {
|
| | | fileResponse.Close();
|
| | | fileResponse = null;
|
| | | }
|
| | |
|
| | | fileWriteState = FileWriteState.Completed;
|
| | | }
|
| | | }
|
| | |
| | | public void RefreshXBTools()
|
| | | {
|
| | | int xbToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(1,out xbToolCnt))
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(1,out xbToolCnt,out needToolCnt))
|
| | | {
|
| | | toolXBShowObj.SetActive(true);
|
| | | toolNumText.text = StringUtility.Contact("x", xbToolCnt);
|
| | |
| | | if (XBModel.CheckIsEmptyGrid(PackType.rptTreasure))
|
| | | {
|
| | | int toolCnt = 0;
|
| | | if(XBModel.IsHaveManyXBTool(1,out toolCnt))
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(1,out toolCnt,out needToolCnt))
|
| | | {
|
| | | int needToolCnt = funcSet.costToolNums[1] - toolCnt;
|
| | | needToolCnt= needToolCnt - toolCnt;
|
| | | int needMoney = needToolCnt * xbOneMoney;
|
| | | if(needToolCnt > 0)
|
| | | {
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsHaveManyXBTool(int type, out int toolCnt)
|
| | | public bool IsHaveManyXBTool(int type, out int toolCnt,out int needToolCnt)
|
| | | {
|
| | | toolCnt = 0;
|
| | | needToolCnt = 0;
|
| | | XBFuncSet funcSet = GetXBFuncSet(type);
|
| | | if (funcSet == null) return false;
|
| | |
|
| | | toolCnt = playerPack.GetItemCountByID(PackType.rptItem, funcSet.costToolIds[1]);
|
| | | needToolCnt = funcSet.costToolNums[1];
|
| | | if (toolCnt > 0)
|
| | | {
|
| | | return true;
|
| | |
| | | public const int RuneXB_RedKey = 20302;
|
| | | public const int XBStore_RedKey = 20303;
|
| | | public const int XBWarehouse_RedKey = 20304;
|
| | | public const int BestXB_OneRedKey = 20301001;
|
| | | public const int BestXB_ManyRedKey = 20301002;
|
| | | public const int RuneXB_OneRedKey = 20302001;
|
| | | public const int RuneXB_ManyRedKey = 20302002;
|
| | |
|
| | | public Redpoint mainTopRed = new Redpoint(MainTop_RedKey);
|
| | | public Redpoint happyXBRed = new Redpoint(MainTop_RedKey, HappyXB_RedKey);
|
| | |
| | | public Redpoint runeXBRed = new Redpoint(HappyXB_RedKey, RuneXB_RedKey);
|
| | | public Redpoint xbStoreRed = new Redpoint(HappyXB_RedKey,XBStore_RedKey);
|
| | | public Redpoint xbWarehouseRed = new Redpoint(HappyXB_RedKey,XBWarehouse_RedKey);
|
| | | public Redpoint bestXBOneRed = new Redpoint(BestXB_RedKey,BestXB_OneRedKey);
|
| | | public Redpoint bestXBManyRed = new Redpoint(BestXB_RedKey,BestXB_ManyRedKey);
|
| | | public Redpoint runeXBOneRed = new Redpoint(RuneXB_RedKey, RuneXB_OneRedKey);
|
| | | public Redpoint runeXBManyRed = new Redpoint(RuneXB_RedKey, RuneXB_ManyRedKey);
|
| | |
|
| | | public void RefreshXBWarehouse()
|
| | | {
|
| | |
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.HappyFindTreasure)) return;
|
| | |
|
| | | if (IsHaveFreeXB(1) || IsHaveOneXBTool(1))
|
| | | int xbtoolCnt = 0;
|
| | | int needtoolCnt = 0;
|
| | | if (IsHaveFreeXB(1))
|
| | | {
|
| | | bestXBRed.state = RedPointState.Simple;
|
| | | }
|
| | | else if(IsHaveManyXBTool(1,out xbtoolCnt,out needtoolCnt))
|
| | | {
|
| | | if(xbtoolCnt >= needtoolCnt)
|
| | | {
|
| | | bestXBManyRed.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | bestXBManyRed.state = RedPointState.None;
|
| | | }
|
| | | bestXBOneRed.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | bestXBRed.state = RedPointState.None;
|
| | | bestXBOneRed.state = RedPointState.None;
|
| | | bestXBManyRed.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | if (IsHaveFreeXB(2) || IsHaveOneXBTool(2))
|
| | | if (IsHaveFreeXB(2))
|
| | | {
|
| | | runeXBRed.state = RedPointState.Simple;
|
| | | }
|
| | | else if(IsHaveManyXBTool(2,out xbtoolCnt,out needtoolCnt))
|
| | | {
|
| | | if (xbtoolCnt >= needtoolCnt)
|
| | | {
|
| | | runeXBManyRed.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | runeXBManyRed.state = RedPointState.None;
|
| | | }
|
| | | runeXBOneRed.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | runeXBRed.state = RedPointState.None;
|
| | | runeXBOneRed.state = RedPointState.None;
|
| | | runeXBManyRed.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public void RefreshXBTools()
|
| | | {
|
| | | int xbToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(2, out xbToolCnt))
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(2, out xbToolCnt,out needToolCnt))
|
| | | {
|
| | | toolXBShowObj.SetActive(true);
|
| | | toolNumText.text = StringUtility.Contact("x", xbToolCnt);
|
| | |
| | | if (XBModel.CheckIsEmptyGrid(PackType.rptRunePack))
|
| | | {
|
| | | int toolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(2, out toolCnt))
|
| | | int needToolCnt = 0;
|
| | | if (XBModel.IsHaveManyXBTool(2, out toolCnt,out needToolCnt))
|
| | | {
|
| | | int needToolCnt = funcSet.costToolNums[1] - toolCnt;
|
| | | needToolCnt = funcSet.costToolNums[1] - toolCnt;
|
| | | int needMoney = needToolCnt * xbOneMoney;
|
| | | if (needToolCnt > 0)
|
| | | {
|
| | |
| | |
|
| | | protected virtual void EnterGame()
|
| | | {
|
| | | if (!LaunchPostProcess.Instance.completed)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | Login();
|
| | | }
|
| | |
|
| | |
| | | m_ImgSelected.SetActive(true);
|
| | |
|
| | | taskmodel.GetNowTaskID = Task_ID;
|
| | |
|
| | | if (mainModel.TaskId_Skill1.Contains(Task_ID))
|
| | | {
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | | {
|
| | | taskmodel.CompletionOfTask(Task_ID);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | else
|
| | | {
|
| | | StateDetermination();
|
| | | var mapModel = ModelCenter.Instance.GetModel<MapModel>();
|
| | | var point = mapModel.GetRecommendHangPoint();
|
| | | var config = Config.Instance.Get<MapEventPointConfig>(point);
|
| | | MapTransferUtility.Instance.MoveToNPC(config.NPCID);
|
| | | }
|
| | | return;
|
| | | }
|
| | | switch ((int)taskmodel.GetTaskStatus(Task_ID))
|
| | | {
|
| | | case -5:
|
| | | case 0:
|
| | | DropItemManager.StopMissionPickup = true;//主动停止拾取物品
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | string strNpc = string.Empty;
|
| | | strNpc = ContentText.GetHrefMessage("movenpc");
|
| | | int npcId = 0;
|
| | | int mapID = PlayerDatas.Instance.baseData.MapID;
|
| | | if (int.TryParse(strNpc, out npcId))
|
| | | {
|
| | | var npcConfig = Config.Instance.GetAllValues<mapnpcConfig>();
|
| | | foreach (var value in npcConfig)
|
| | | {
|
| | | if (value.NPCID == npcId && value.MapID != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | }
|
| | | }
|
| | | var MonsterConfig = Config.Instance.Get<MonsterRefreshPointConfig>(npcId);
|
| | | if (MonsterConfig != null && MonsterConfig.MapId != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | StateDetermination();
|
| | | ContentText.ExcuteHref();
|
| | | OpenPanel(Task_ID);
|
| | | break;
|
| | |
| | | break;
|
| | | case 3:
|
| | | taskmodel.CompletionOfTask(Task_ID);
|
| | | if (mainModel.TaskId_Skill.Contains(Task_ID))
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | private void StateDetermination()//状态判定
|
| | | {
|
| | | DropItemManager.StopMissionPickup = true;//主动停止拾取物品
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | string strNpc = string.Empty;
|
| | | strNpc = ContentText.GetHrefMessage("movenpc");
|
| | | int npcId = 0;
|
| | | int mapID = PlayerDatas.Instance.baseData.MapID;
|
| | | if (int.TryParse(strNpc, out npcId))
|
| | | {
|
| | | var npcConfig = Config.Instance.GetAllValues<mapnpcConfig>();
|
| | | foreach (var value in npcConfig)
|
| | | {
|
| | | if (value.NPCID == npcId && value.MapID != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | }
|
| | | }
|
| | | var MonsterConfig = Config.Instance.Get<MonsterRefreshPointConfig>(npcId);
|
| | | if (MonsterConfig != null && MonsterConfig.MapId != mapID)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Task_Transfer1");
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void OnClickDeliveryButton()//传送符
|
| | | {
|
| | | mainModel.FlyShoseTaskID = Task_ID;
|
| | |
| | | }
|
| | | string str = taskmodel.allMissionDict[TaskID].InforList;
|
| | | var taskinfo = Config.Instance.Get<TASKINFOConfig>(str);
|
| | | if (taskinfo != null)
|
| | | if (mainModel.TaskId_Skill1.Contains(TaskID))//特殊任务
|
| | | {
|
| | | m_ContentText.text = taskinfo.show_writing;
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | string Str_A = string.Format(Language.Get("PassiveSkillTask1"), mainModel.ItemID, itemNumber);
|
| | | string Str_B = Language.Get("PassiveSkillTask2");
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | | {
|
| | | m_ContentText.text = Str_B;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContentText.text = Str_A;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.LogError("任务表格PyTaskInfo配置缺失");
|
| | | return;
|
| | | }
|
| | |
|
| | | if (taskinfo != null)
|
| | | {
|
| | | m_ContentText.text = taskinfo.show_writing;
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.LogError("任务表格PyTaskInfo配置缺失");
|
| | | return;
|
| | | }
|
| | | } |
| | | bool isOPenTransferButton = HrefAnalysis.Inst.ContainsKey(taskinfo.show_writing, "flynpc");
|
| | | if (isOPenTransferButton && !IsKaJiBool)
|
| | | {
|
| | |
| | | }
|
| | | private void GodBeastBtn()
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("FuncNextVersion");//信息提示
|
| | | return;
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<DogzWin>();
|
| | | }
|
| | |
| | | OneKeyList.Add(Listmap[i]);
|
| | | }
|
| | | NetworkState = (int)SDKUtility.Instance.NetworkType;
|
| | | GetPassiveSkillTask();
|
| | | }
|
| | | //----------关于某些副本可以进行地图挂机
|
| | | public List<int> OneKeyList = new List<int>();
|
| | |
| | | //----------使用娲皇卷轴后的Buff表现
|
| | | public static event Action EmperorBuffEvent;
|
| | | public bool IsEmperor = false;
|
| | |
|
| | | //---------关于任务需要的数据
|
| | | public List<int> TaskId_Skill = new List<int>();
|
| | | public List<int> TaskId_Skill1 = new List<int>();
|
| | | public int ItemID = 0;
|
| | | public int UnitPrice = 0;
|
| | | public int ItemNumber = 0;
|
| | |
|
| | |
|
| | | private void GetPassiveSkillTask()//获取任务数据
|
| | | {
|
| | | TaskId_Skill.Clear();
|
| | | TaskId_Skill1.Clear();
|
| | | var PassiveSkillTaskconfig = Config.Instance.Get<FuncConfigConfig>("PassiveSkillTask");
|
| | | int[] TaskId_SkillInt = ConfigParse.GetMultipleStr<int>(PassiveSkillTaskconfig.Numerical1);
|
| | | for (int i = 0; i < TaskId_SkillInt.Length; i++)
|
| | | {
|
| | | TaskId_Skill.Add(TaskId_SkillInt[i]);
|
| | | }
|
| | | int[] TaskId_SkillInt1 = ConfigParse.GetMultipleStr<int>(PassiveSkillTaskconfig.Numerical2);
|
| | | for (int i = 0; i < TaskId_SkillInt1.Length; i++)
|
| | | {
|
| | | TaskId_Skill1.Add(TaskId_SkillInt1[i]);
|
| | | }
|
| | | int[] PassiveSkillTask = ConfigParse.GetMultipleStr<int>(PassiveSkillTaskconfig.Numerical3);
|
| | | if (PassiveSkillTask.Length >= 3)
|
| | | {
|
| | | ItemID = PassiveSkillTask[0];
|
| | | UnitPrice = PassiveSkillTask[1];
|
| | | ItemNumber = PassiveSkillTask[2];
|
| | | } |
| | | }
|
| | |
|
| | |
|
| | | private void UseItemSuccessAct(int Index, int ItemID)
|
| | | {
|
| | | if (ItemID == 221)
|
| | |
| | | using TableConfig;
|
| | | using System.Collections.Generic;
|
| | | //任务面板的支线任务
|
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class SideMission:MonoBehaviour {
|
| | | public class SideMission : MonoBehaviour
|
| | | {
|
| | | [SerializeField] ScrollerController _TaskRamusList;
|
| | | //右侧面板
|
| | | [SerializeField] Text _Text_TaskName;//任务名
|
| | |
| | | PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } }
|
| | | ItemTipsModel _itemTipsModel;
|
| | | ItemTipsModel itemTipsModel { get { return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | PlayerMainDate m_MainModel;
|
| | | PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
|
| | | private List<RewardAnalysis.RewardInfo> rewardList = new List<RewardAnalysis.RewardInfo>();
|
| | | private int TaskIdNow = 0;
|
| | | private void Awake()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | private void Start()
|
| | | {
|
| | |
| | | {
|
| | | TaskIdNow = 0;
|
| | | _TaskRamusList.OnRefreshCell += OnRefreshGridCell;
|
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;
|
| | | OnCreateGridLineCell(_TaskRamusList);
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | | {
|
| | | _TaskRamusList.OnRefreshCell -= OnRefreshGridCell;
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | }
|
| | |
|
| | | private void ItemCntReduceAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptItem && arg3 == mainModel.ItemID)
|
| | | {
|
| | | foreach (var key in taskmodel.SideQuestsDic.Keys)
|
| | | {
|
| | | if (mainModel.TaskId_Skill1.Contains(key))
|
| | | {
|
| | | _TaskRamusList.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptItem && arg3 == mainModel.ItemID)
|
| | | {
|
| | | foreach (var key in taskmodel.SideQuestsDic.Keys)
|
| | | {
|
| | | if (mainModel.TaskId_Skill1.Contains(key))
|
| | | {
|
| | | _TaskRamusList.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ForwardButton()
|
| | | {
|
| | | if (mainModel.TaskId_Skill1.Contains(TaskIdNow))
|
| | | {
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskIdNow);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | else
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | int GoldPaper = (int)UIHelper.GetMoneyCnt(2);//绑玉
|
| | | string strNull = string.Empty;
|
| | | int needNumber = (mainModel.ItemNumber - itemNumber) * mainModel.UnitPrice;//所需金额
|
| | | if (GoldPaper >= needNumber)
|
| | | {
|
| | | strNull = string.Format(Language.Get("PassiveSkillTask3"), needNumber);
|
| | | }
|
| | | else
|
| | | {
|
| | | strNull = string.Format(Language.Get("PassiveSkillTask4"), needNumber, GoldPaper, needNumber- GoldPaper);
|
| | | }
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | |
| | | if (isOk)
|
| | | {
|
| | | if (Gold + GoldPaper >= needNumber)
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskIdNow);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | } |
| | | });
|
| | |
|
| | | }
|
| | | return;
|
| | | }
|
| | | if ((int)taskmodel.GetTaskStatus(TaskIdNow) == 3)
|
| | | {
|
| | | taskmodel.CompletionOfTask(TaskIdNow);
|
| | | if (mainModel.TaskId_Skill.Contains(TaskIdNow))
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | _Text_TaskTarget.ExcuteHref();
|
| | | }
|
| | | |
| | |
|
| | | WindowCenter.Instance.CloseImmediately<TaskWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | }
|
| | |
| | | var taskname = taskmodel.SideQuestsDic[TaskId].Name;
|
| | | if (Config.Instance.Get<TASKINFOConfig>(taskname) == null)
|
| | | {
|
| | | DebugEx.LogError("TASKINFO任务表格没有获取到该任务名称"+ taskname);
|
| | | DebugEx.LogError("TASKINFO任务表格没有获取到该任务名称" + taskname);
|
| | | return;
|
| | | }
|
| | | sideMissionTitleBtton.TitleName.text= Config.Instance.Get<TASKINFOConfig>(taskname).show_writing;//任务名
|
| | | sideMissionTitleBtton.TitleName.text = Config.Instance.Get<TASKINFOConfig>(taskname).show_writing;//任务名
|
| | | if (!taskmodel.SideQuestsDic.ContainsKey(TaskId))
|
| | | {
|
| | | return;
|
| | | }
|
| | | sideMissionTitleBtton.Text_RamusState.text = GegionalTaskStatus(taskmodel.SideQuestsDic[TaskId].MissionState);
|
| | | sideMissionTitleBtton.SideMissionTitleBtton1.RemoveAllListeners();
|
| | | sideMissionTitleBtton.SideMissionTitleBtton1.AddListener(()=> |
| | | sideMissionTitleBtton.SideMissionTitleBtton1.AddListener(() =>
|
| | | {
|
| | | if (TaskId != TaskIdNow)
|
| | | {
|
| | |
| | | _Text_TaskName.text = Config.Instance.Get<TASKINFOConfig>(taskmodel.SideQuestsDic[taskID].Name).show_writing;//任务名
|
| | | _Text_TaskDescribe.text = Config.Instance.Get<TASKINFOConfig>(taskmodel.SideQuestsDic[taskID].Desclist).show_writing;//任务描述
|
| | | string strINfor = taskmodel.SideQuestsDic[taskID].InforList;
|
| | | string str = Config.Instance.Get<TASKINFOConfig>(strINfor).show_writing;
|
| | | string str = string.Empty;
|
| | | if (mainModel.TaskId_Skill1.Contains(taskID))
|
| | | {
|
| | | int itemNumber = playerPack.GetItemCountByID(PackType.rptItem, mainModel.ItemID);//获取特殊物品
|
| | | if (itemNumber >= mainModel.ItemNumber)
|
| | | {
|
| | | string Str_A = string.Format(Language.Get("PassiveSkillTask1"), mainModel.ItemID, mainModel.ItemNumber);
|
| | | str = Str_A;
|
| | | }
|
| | | else
|
| | | {
|
| | | string Str_A = string.Format(Language.Get("PassiveSkillTask1"), mainModel.ItemID, itemNumber);
|
| | | str = Str_A;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | str = Config.Instance.Get<TASKINFOConfig>(strINfor).show_writing;
|
| | | } |
| | | str = WordAnalysis.Color_Start_Regex.Replace(str, string.Empty);
|
| | | str = WordAnalysis.Color_End_Regex.Replace(str, string.Empty);
|
| | | _Text_TaskTarget.text = str;//任务目标
|
| | | if ((int)taskmodel.GetTaskStatus(TaskIdNow) == 3)
|
| | | |
| | | if ((int)taskmodel.GetTaskStatus(TaskIdNow) == 3 || mainModel.TaskId_Skill1.Contains(taskID))//能够进行立即完成的支线任务
|
| | | {
|
| | | _Text_Forward.text = string.Format(Language.Get("FinishAtOnce_Z")) ;
|
| | | _Text_Forward.text = string.Format(Language.Get("FinishAtOnce_Z"));
|
| | | }
|
| | | else
|
| | | {
|
| | | _Text_Forward.text = TaskStatus(taskmodel.SideQuestsDic[taskID].MissionState);
|
| | | }
|
| | | |
| | |
|
| | | if (taskmodel._DicTaskInformation.ContainsKey(taskID))
|
| | | {
|
| | | _Text_TaskTarget.SetReplaceInfo(taskmodel._DicTaskInformation[taskID]);
|
| | | }
|
| | | |
| | |
|
| | | if (taskmodel.SideQuestsDic[taskID].RewardList == null)
|
| | | {
|
| | | if (_Grid.childCount != 0)
|
| | |
| | | TreasureModel model { get { return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<TreasureModel>()); } }
|
| | | PlayerTaskDatas m_TaskModel;
|
| | | PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | PlayerMainDate m_MainModel;
|
| | | PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
|
| | | List<int> RenzhuTaskIDList = new List<int>();//法宝任务数组ID
|
| | | List<int> ListSort = new List<int>();//用于排列顺序(未卡级)
|
| | | List<int> ListSort1 = new List<int>();//用于排序(卡级)
|
| | |
| | | PlayerTaskDatas.Event_TaskRefreshes += TaskRefreshes;//任务的刷新
|
| | | PlayerTaskDatas.Event_TaskToDelete += OnTaskToDelete;//任务的删除
|
| | | PlayerTaskDatas.Event_TaskInformation += TaskInformation;//任务字典信息
|
| | | //PlayerTaskDatas.CardLevelChange += CardLevelChange;//任务卡级状态改变
|
| | | PlayerTaskDatas.MainCardLevelChange += MainCardLevelChange;//卡级任务修改
|
| | | model.collectingTreasureChangeEvent += OnCollectingTreasureChangeEvent;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent += CloseTreasureNewGotWinEvent;
|
| | |
|
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;
|
| | | OnCollectingTreasureChangeEvent(TreasureCategory.Human);
|
| | | TaskScheduling();//任务排序 1
|
| | | TheTaskToGenerate();//任务生成
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent -= CloseTreasureNewGotWinEvent;
|
| | | PlayerTaskDatas.MainCardLevelChange -= MainCardLevelChange;//卡级任务修改
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;
|
| | | }
|
| | |
|
| | | private void ItemCntReduceAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptItem && arg3== mainModel.ItemID)
|
| | | {
|
| | | foreach (var key in taskmodel.SideQuestsDic.Keys)
|
| | | {
|
| | | if (mainModel.TaskId_Skill1.Contains(key))
|
| | | {
|
| | | TaskIdUpdate(key);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptItem && arg3 == mainModel.ItemID)
|
| | | {
|
| | | foreach (var key in taskmodel.SideQuestsDic.Keys)
|
| | | {
|
| | | if (mainModel.TaskId_Skill1.Contains(key))
|
| | | {
|
| | | TaskIdUpdate(key);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void TaskIdUpdate(int taskId)
|
| | | {
|
| | | int leng = Content.childCount;
|
| | | for (int i = 0; i < leng; i++)
|
| | | {
|
| | | GameObject childObj = Content.GetChild(i).gameObject;
|
| | | TaskType childObjTaskType = Content.GetChild(i).gameObject.GetComponent<TaskType>();
|
| | | if (childObj.activeSelf && childObjTaskType.TaskID == taskId)
|
| | | {
|
| | | childObj.GetComponent<FlyingShoesTask>().FlyingShoes_Task(taskId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void MainCardLevelChange(int _id)
|
| | | {
|
| | |
|
| | | TaskScheduling();
|
| | | bool IsDefault = true;
|
| | | var State = taskmodel.GetTaskStatus(_id);
|
| | |
| | | {
|
| | | _list.Sort(Compare1);//卡级排序
|
| | | }
|
| | |
|
| | | }
|
| | | int Compare(int x, int y)//默认排序(无卡级)
|
| | | {
|
| | |
| | | var _position = (_list.Count - type) * m_SizeHeight + (_list.Count - type - 1) * 2;
|
| | | _position -= 196;
|
| | | m_ScrollRect.verticalNormalizedPosition = Mathf.Clamp01(_position / ((Content as RectTransform).sizeDelta.y - 196));
|
| | | // m_ScrollRect.verticalNormalizedPosition = Mathf.Clamp01(m_ScrollRect.verticalNormalizedPosition + ((Content as RectTransform).sizeDelta.y - 196));
|
| | | //m_ScrollRect.verticalNormalizedPosition = ((float)1 - (float)(type + 1) / _list.Count);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField, Header("展示时间")] float m_DisplayTime = 15f;
|
| | | [SerializeField, Header("特效位置")] Vector3 m_EffectPosition = Vector3.zero;
|
| | |
|
| | | UI3DShowHero showHero = new UI3DShowHero();
|
| | | GameObject clothesModel;
|
| | | Animator clothesAnimator;
|
| | |
|
| | | Transform showPoint;
|
| | |
|
| | | List<SFXController> closthesSFXList = new List<SFXController>();
|
| | |
|
| | | static RealmBossShow m_Instance = null;
|
| | | public static RealmBossShow Instance
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | var _hero = showHero.Show(_job, _clothesId, _suitLevel, _weaponId, _wingsId, _secondaryId, m_HeroStage);
|
| | | showPoint = m_HeroStage;
|
| | | var _hero = ShowHero(_job, _clothesId, _suitLevel, _weaponId, _wingsId, _secondaryId);
|
| | | if (_hero != null)
|
| | | {
|
| | | showHero.SitDown();
|
| | | SitDown();
|
| | | LayerUtility.SetLayer(m_HeroStage.gameObject, LayerUtility.BossShow, true);
|
| | | }
|
| | | }
|
| | |
| | | showCamera.enabled = false;
|
| | | m_Effect.gameObject.SetActive(false);
|
| | | transform.localPosition = new Vector3(0, 4000, 5000);
|
| | | showHero.Dispose();
|
| | | if (m_Effect != null)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | m_Effect = null;
|
| | | }
|
| | |
|
| | | for (int i = closthesSFXList.Count - 1; i >= 0; i--)
|
| | | {
|
| | | if (closthesSFXList[i] != null)
|
| | | {
|
| | | Destroy(closthesSFXList[i].gameObject);
|
| | | }
|
| | | }
|
| | | closthesSFXList.Clear();
|
| | |
|
| | | if (clothesModel != null)
|
| | | {
|
| | | Destroy(clothesModel);
|
| | | clothesModel = null;
|
| | | clothesAnimator = null;
|
| | | }
|
| | | }
|
| | |
|
| | | GameObject ShowHero(int _job, int _clothes, int suitID, int _weaponId, int _wingsId, int _secondaryId)
|
| | | {
|
| | | PutOnClothes(_job, _clothes, suitID);
|
| | | return clothesModel;
|
| | | }
|
| | |
|
| | | public void SitDown()
|
| | | {
|
| | | if (clothesModel != null)
|
| | | {
|
| | | var animator = clothesModel.GetComponent<Animator>();
|
| | | animator.Play(GAStaticDefine.State_SitDown);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnClothes(int _job, int itemID, int suitID)
|
| | | {
|
| | | var newClothes = 0;
|
| | | var config = Config.Instance.Get<JobSetupConfig>(_job);
|
| | |
|
| | | if (itemID == 0)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | }
|
| | | else
|
| | | {
|
| | | var item = Config.Instance.Get<ItemConfig>(itemID);
|
| | | newClothes = item == null ? newClothes = config.BaseEquip[0] : item.ChangeOrd;
|
| | | }
|
| | |
|
| | | var _prefab = InstanceResourcesLoader.LoadModelRes(newClothes);
|
| | | if (!_prefab)
|
| | | {
|
| | | newClothes = config.BaseEquip[0];
|
| | | }
|
| | |
|
| | | LoadClothes(newClothes);
|
| | |
|
| | | LoadClothesEffect(_job, itemID, suitID);
|
| | | }
|
| | |
|
| | | private void LoadClothes(int resID)
|
| | | {
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(resID);
|
| | | if (clothesModel == null)
|
| | | {
|
| | | clothesModel = Instantiate(prefab, Constants.Special_Hide_Position, Quaternion.identity);
|
| | | }
|
| | |
|
| | | clothesModel.transform.SetParent(null);
|
| | | clothesModel.transform.localScale = Vector3.one;
|
| | |
|
| | | LayerUtility.SetLayer(clothesModel, LayerUtility.Player, false);
|
| | | var skinnedMeshRenderer = clothesModel.GetComponentInChildren<SkinnedMeshRenderer>(true);
|
| | | LayerUtility.SetLayer(skinnedMeshRenderer.gameObject, LayerUtility.Player, false);
|
| | | clothesModel.SetActive(true);
|
| | | clothesModel.transform.SetParentEx(showPoint, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | clothesAnimator = clothesModel.GetComponent<Animator>();
|
| | |
|
| | | if (clothesAnimator == null)
|
| | | {
|
| | | DebugEx.LogErrorFormat("角色资源: {0} 没有动画控制器", resID);
|
| | | }
|
| | |
|
| | | // 动画状态机修改
|
| | | if (clothesAnimator)
|
| | | {
|
| | | RuntimeAnimatorController _controller = AnimatorControllerLoader.Load(AnimatorControllerLoader.controllerUISuffix, resID);
|
| | | clothesAnimator.runtimeAnimatorController = _controller;
|
| | | clothesAnimator.enabled = true;
|
| | | }
|
| | | }
|
| | |
|
| | | public void LoadClothesEffect(int job,int clothedID, int suitLevel)
|
| | | {
|
| | | var _equipModel = ModelCenter.Instance.GetModel<PlayerPackModel>().GetSinglePackModel(PackType.rptEquip);
|
| | | if (_equipModel == null)
|
| | | {
|
| | | if (DTC0309_tagPlayerLoginInfo.equipSuitID > 0)
|
| | | {
|
| | | PutOnEffect(DTC0309_tagPlayerLoginInfo.equipSuitID);
|
| | | }
|
| | | return;
|
| | | }
|
| | |
|
| | | int _suitCount = 0;
|
| | |
|
| | | int _start = (int)RoleEquipType.retHat;
|
| | | int _end = (int)RoleEquipType.retShoes;
|
| | |
|
| | | ItemModel _itemModel = null;
|
| | |
|
| | | _itemModel = _equipModel.GetItemModelByIndex((int)RoleEquipType.retClothes);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | int _rank = _itemModel.chinItemModel.LV;
|
| | |
|
| | | for (int i = _start; i <= _end; ++i)
|
| | | {
|
| | | _itemModel = _equipModel.GetItemModelByIndex(i);
|
| | |
|
| | | if (_itemModel == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (_itemModel.chinItemModel.SuiteiD <= 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (i == (int)RoleEquipType.retClothes)
|
| | | {
|
| | | _rank = _itemModel.chinItemModel.LV;
|
| | | }
|
| | |
|
| | | var suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>();
|
| | | if (suitModel.suitModelDict.ContainsKey(i))
|
| | | {
|
| | | if (suitModel.suitModelDict[i].ContainsKey(1)
|
| | | || suitModel.suitModelDict[i].ContainsKey(2))
|
| | | {
|
| | | if (_itemModel.chinItemModel.LV >= _rank)
|
| | | {
|
| | | _suitCount += 1;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (_suitCount == 5)
|
| | | {
|
| | | int _type = 1;
|
| | |
|
| | | int _suitEffectID = _type * 1000 + job * 100 + _rank;
|
| | |
|
| | | PutOnEffect(_suitEffectID);
|
| | | }
|
| | | }
|
| | |
|
| | | public void PutOnEffect(int id)
|
| | | {
|
| | | SuitEffectConfig _suitEffect = Config.Instance.Get<SuitEffectConfig>(id);
|
| | |
|
| | | // 上特效
|
| | | if (_suitEffect != null)
|
| | | {
|
| | | Transform _parent = null;
|
| | | SFXController _sfx = null;
|
| | | for (int i = 0; _suitEffect.bindbones != null && i < _suitEffect.bindbones.Length; ++i)
|
| | | {
|
| | | if (string.IsNullOrEmpty(_suitEffect.bindbones[i])
|
| | | || _suitEffect.effectIds[i] == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | _parent = clothesModel.transform.GetChildTransformDeeply(_suitEffect.bindbones[i]);
|
| | |
|
| | | if (_parent == null)
|
| | | {
|
| | | Debug.LogErrorFormat("套装: {0} 配置的骨骼节点: {1} 不存在", id, _suitEffect.bindbones[i]);
|
| | | continue;
|
| | | }
|
| | |
|
| | | _sfx = SFXPlayUtility.Instance.PlayBattleEffect(_suitEffect.effectIds[i], _parent);
|
| | | closthesSFXList.Add(_sfx);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | {
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= RefreshFamilyLv;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += RefreshFamilyLv;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine -= RefreshServerHour;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine += RefreshServerHour;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= FuncStateChange;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
|
| | | RefreshTCBPlayerDataEvent -= RefreshPlayerLv;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (Quality < 10 && GodBeastBagList[i].IsEquipment != 1 && GodBeastBagList[i].Color > Quality)//过滤掉只剩所选品质装备
|
| | | if (Quality < 10 && (GodBeastBagList[i].IsEquipment != 1 || GodBeastBagList[i].Color > Quality))//过滤掉只剩所选品质装备
|
| | | {
|
| | | int type = i;
|
| | | DeleteIndexList.Add(type);
|
| | |
| | | [SerializeField] ScrollRect m_AchievementScroller;
|
| | | [SerializeField] FurnacesAchievement[] m_FurnacesAchievements;
|
| | | [SerializeField] Button m_AchievementGetBtn;
|
| | | [SerializeField] Button m_ActiveBtn;
|
| | | [SerializeField] RectTransform m_ContainerHoles;
|
| | | [SerializeField] Image[] m_FurnacesIcons;
|
| | | [SerializeField] RectTransform m_ContainerFunc;
|
| | |
| | | {
|
| | | m_AchievementGetBtn.onClick.AddListener(OnAchievementGet);
|
| | | m_GotoStove.onClick.AddListener(GotoStove);
|
| | | m_ActiveBtn.onClick.AddListener(Active);
|
| | | }
|
| | |
|
| | | public override void Display(int _treasureId, bool _tween = false)
|
| | | {
|
| | | base.Display(_treasureId);
|
| | | m_GotoGet.onClick.RemoveAllListeners();
|
| | | m_GotoGet.onClick.AddListener(GotoGet);
|
| | |
|
| | |
| | | DisplayFurnacesHole();
|
| | | DisplayFurnace();
|
| | | DisplayFunc();
|
| | |
|
| | | achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
|
| | | achievementModel.achievementCompletedEvent += AchievementCompletedEvent;
|
| | | model.treasureStageUpEvent -= TreasureStageUpEvent;
|
| | | model.treasureStageUpEvent += TreasureStageUpEvent;
|
| | |
|
| | | completedAchivement = 0;
|
| | |
|
| | |
| | | {
|
| | | m_GotoGet.onClick.RemoveAllListeners();
|
| | | achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
|
| | | model.treasureStageUpEvent -= TreasureStageUpEvent;
|
| | | for (int i = 0; i < m_FurnacesAchievements.Length; i++)
|
| | | {
|
| | | m_FurnacesAchievements[i].Dispose();
|
| | | }
|
| | | }
|
| | |
|
| | | private void TreasureStageUpEvent(int _id)
|
| | | {
|
| | | if (_id == treasureId && model.serverInited)
|
| | | {
|
| | | TreasureActiveEffect();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | _effect.OnComplete = null;
|
| | | m_FurnacesIcons[_index].gameObject.SetActive(true);
|
| | | if (_index == m_FurnacesIcons.Length - 1)
|
| | | {
|
| | | TreasureActiveEffect();
|
| | | }
|
| | | //if (_index == m_FurnacesIcons.Length - 1)
|
| | | //{
|
| | | // TreasureActiveEffect();
|
| | | //}
|
| | | };
|
| | | }
|
| | | continue;
|
| | |
| | | var unlockTreasureConfig = Config.Instance.Get<TreasureConfig>(unlocktreasureId);
|
| | |
|
| | | m_AchievementGetBtn.gameObject.SetActive(false);
|
| | | m_ActiveBtn.gameObject.SetActive(false);
|
| | | m_GotoGet.gameObject.SetActive(false);
|
| | | m_ContainerLocked.gameObject.SetActive(true);
|
| | | m_LockedDescription.text = Language.Get("BlastFurnaceGet", unlockTreasureConfig == null ? string.Empty : unlockTreasureConfig.Name);
|
| | |
| | | m_AchievementGetBtn.gameObject.SetActive(false);
|
| | | m_GotoGet.gameObject.SetActive(false);
|
| | | m_ContainerLocked.gameObject.SetActive(false);
|
| | | m_ActiveBtn.gameObject.SetActive(currentAchievement == null && treasure.stage == 0);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerLocked.gameObject.SetActive(false);
|
| | | m_ActiveBtn.gameObject.SetActive(false);
|
| | | var _isReach = Achievement.IsReach(currentAchievement.id, currentAchievement.progress);
|
| | | m_AchievementGetBtn.gameObject.SetActive(_isReach);
|
| | | var _list = model.GetFurnacesAchievements();
|
| | |
| | | WindowCenter.Instance.Open<BlastFurnaceWin>();
|
| | | }
|
| | |
|
| | | private void Active()
|
| | | {
|
| | | CA515_tagCMMagicWeaponUp _pak = new CA515_tagCMMagicWeaponUp();
|
| | | _pak.MWID = (uint)treasureId;
|
| | | GameNetSystem.Instance.SendInfo(_pak);
|
| | | }
|
| | |
|
| | |
|
| | | private void GetCurrentAchievement()
|
| | | {
|
| | |
| | | {
|
| | | if (item.achievementGroup != datas[preIndex + i])
|
| | | {
|
| | | item.gameObject.SetActive(true);
|
| | | item.Display(datas[preIndex + i]);
|
| | | }
|
| | | }
|
| | |
| | | treasureAchievementDict.Add(config.ID, config.Achievements[i]);
|
| | | break;
|
| | | }
|
| | | else if (config.Category == (int)TreasureCategory.Fairy && config.ID == 301)
|
| | | {
|
| | | eightFurnacesAchievements.Add(config.Achievements[i]);
|
| | | }
|
| | | //else if (config.Category == (int)TreasureCategory.Fairy && config.ID == 301)
|
| | | //{
|
| | | // eightFurnacesAchievements.Add(config.Achievements[i]);
|
| | | //}
|
| | | }
|
| | |
|
| | | if (treasure.state == TreasureState.Locked && config.PreTreasure == 0)
|
| | |
| | | {
|
| | | treasureMapDict.Add(config.ID, config.MapId);
|
| | | }
|
| | |
|
| | | if (config.ID == 301)
|
| | | {
|
| | | List<int> list = null;
|
| | | SuccessConfig.TryGetTreasureExpAchievements(config.ID, out list);
|
| | | if (list != null)
|
| | | {
|
| | | eightFurnacesAchievements.AddRange(list);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | var treasureUpConfigs = Config.Instance.GetAllValues<TreasureUpConfig>();
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(weaponId);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(weaponModel);
|
| | | pool.Release(weaponModel);
|
| | | weaponModel = null;
|
| | | }
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(secondaryId);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(secondaryModel);
|
| | | pool.Release(secondaryModel);
|
| | | secondaryModel.SetActive(true);
|
| | | secondaryModel = null;
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(wingsId);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(wingsModel);
|
| | | pool.Release(wingsModel);
|
| | | wingsModel = null;
|
| | | wingsAnimator = null;
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(clothesId);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(clothesModel);
|
| | | pool.Release(clothesModel);
|
| | | clothesModel = null;
|
| | | if (clothesAnimator)
|
| | |
| | |
|
| | | if (weaponModel)
|
| | | {
|
| | | ResetModelLayer(weaponModel);
|
| | | GameObject prefab = InstanceResourcesLoader.LoadModelRes(weaponId);
|
| | | GameObjectPoolManager.Instance.ReleaseGameObject(prefab, weaponModel);
|
| | | weaponModel = null;
|
| | |
| | |
|
| | | var prefab = InstanceResourcesLoader.LoadModelRes(clothesId);
|
| | | var pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(clothesModel);
|
| | | pool.Release(clothesModel);
|
| | | clothesModel = null;
|
| | | if (clothesAnimator != null)
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(oldWeapon);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(weaponModel);
|
| | | pool.Release(weaponModel);
|
| | | weaponModel = null;
|
| | | }
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(oldSecondary);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(secondaryModel);
|
| | | pool.Release(secondaryModel);
|
| | | secondaryModel = null;
|
| | | }
|
| | |
| | | }
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | secondaryModel = pool.Request();
|
| | |
|
| | | secondaryModel.layer = LayerUtility.Player;
|
| | | SkinnedMeshRenderer _renderer = secondaryModel.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (_renderer)
|
| | | {
|
| | | _renderer.gameObject.layer = LayerUtility.Player;
|
| | | }
|
| | |
|
| | | var parent = clothesModel.transform.GetChildTransformDeeply(GAStaticDefine.SecondaryBindBoneName[job - 1]);
|
| | | secondaryModel.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | |
| | | {
|
| | | prefab = InstanceResourcesLoader.LoadModelRes(oldWings);
|
| | | pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
| | | ResetModelLayer(wingsModel);
|
| | | pool.Release(wingsModel);
|
| | | wingsModel = null;
|
| | | }
|
| | |
| | | SFXPlayUtility.Instance.Release(closthesSFXList[i]);
|
| | | }
|
| | | closthesSFXList.Clear();
|
| | | }
|
| | |
|
| | | void ResetModelLayer(GameObject _go)
|
| | | {
|
| | | if (_go != null)
|
| | | {
|
| | | var skinMeshRender = _go.GetComponentInChildren<SkinnedMeshRenderer>();
|
| | | if (skinMeshRender != null)
|
| | | {
|
| | | skinMeshRender.gameObject.layer = LayerUtility.Player;
|
| | | }
|
| | | LayerUtility.SetLayer(_go, LayerUtility.Player, false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|