Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
8 文件已复制
1个文件已删除
1 文件已重命名
10个文件已添加
61个文件已修改
| | |
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PresetUnlockConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(RandomNameConfig),
|
| | | typeof(SignInConfig),
|
| | |
| | | ClearConfigDictionary<PlayerAttrConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PresetUnlockConfig 字典
|
| | | ClearConfigDictionary<PresetUnlockConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| | | ClearConfigDictionary<PriorBundleConfig>();
|
| | | // 清空 RandomNameConfig 字典
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Thursday, January 8, 2026 |
| | | // [ Date ]: Tuesday, January 20, 2026 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public int[][] AwardList; |
| | | public int[] LineupIDList; |
| | | public long FightPower; |
| | | public int NPCID; |
| | | public int[] SkillIDExList; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | |
| | | } |
| | | |
| | | long.TryParse(tables[6],out FightPower); |
| | | |
| | | int.TryParse(tables[7],out NPCID); |
| | | |
| | | if (tables[8].Contains("[")) |
| | | { |
| | | SkillIDExList = JsonMapper.ToObject<int[]>(tables[8]); |
| | | } |
| | | else |
| | | { |
| | | string[] SkillIDExListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkillIDExList = new int[SkillIDExListStringArray.Length]; |
| | | for (int i=0;i<SkillIDExListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SkillIDExListStringArray[i],out SkillIDExList[i]); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception exception) |
| | | { |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2026年1月19日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class PresetUnlockConfig : ConfigBase<int, PresetUnlockConfig>
|
| | | {
|
| | | static PresetUnlockConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ID;
|
| | | public int PresetType;
|
| | | public int PresetID;
|
| | | public int UnlockType;
|
| | | public int UnlockValue;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out ID); |
| | |
|
| | | int.TryParse(tables[1],out PresetType); |
| | |
|
| | | int.TryParse(tables[2],out PresetID); |
| | |
|
| | | int.TryParse(tables[3],out UnlockType); |
| | |
|
| | | int.TryParse(tables[4],out UnlockValue); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Config/Configs/PresetUnlockConfig.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: 8ecdeb51d01330b43960aae797dd7d53 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class PresetUnlockConfig : ConfigBase<int, PresetUnlockConfig> |
| | | { |
| | | static Dictionary<int, Dictionary<int, PresetUnlockConfig>> m_PresetUnlockDict = new Dictionary<int, Dictionary<int, PresetUnlockConfig>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!m_PresetUnlockDict.ContainsKey(PresetType)) |
| | | { |
| | | m_PresetUnlockDict[PresetType] = new Dictionary<int, PresetUnlockConfig>(); |
| | | } |
| | | m_PresetUnlockDict[PresetType][PresetID] = this; |
| | | } |
| | | |
| | | public static PresetUnlockConfig GetPresetUnlockConfig(int presetType, int presetID) |
| | | { |
| | | if (m_PresetUnlockDict.ContainsKey(presetType) && m_PresetUnlockDict[presetType].ContainsKey(presetID)) |
| | | { |
| | | return m_PresetUnlockDict[presetType][presetID]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Config/PartialConfigs/PresetUnlockConfig.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: 25d58f7d8e96c334aa6041e24810a2d2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | |
|
| | | public class CB412_tagCSHeroPresetSave : GameNetPackBasic {
|
| | | public byte PresetID; //阵容方案预设ID
|
| | | public byte ShapeType; //本阵容阵型,0为默认阵型,可扩展不同的阵型
|
| | | public byte PosCnt;
|
| | | public tagCSHeroPresetPos[] HeroPosList; // 保存的阵容,只发送最终的阵容武将位置即可
|
| | |
|
| | |
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (PresetID, NetDataType.BYTE);
|
| | | WriteBytes (ShapeType, NetDataType.BYTE);
|
| | | WriteBytes (PosCnt, NetDataType.BYTE);
|
| | | for (int i = 0; i < PosCnt; i ++) {
|
| | | WriteBytes (HeroPosList[i].ItemIndex, NetDataType.WORD);
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A0 01 Gm广播消息#tagBroadCastInfo |
| | | |
| | | public class DTCA001_tagBroadCastInfo : DtcBasic |
| | | { |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | | base.Done(vNetPack); |
| | | HA001_tagBroadCastInfo vNetData = vNetPack as HA001_tagBroadCastInfo; |
| | | GMNotifyManager.Instance.Notify(vNetData); |
| | | } |
| | | } |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA0_Sys/DTCA001_tagBroadCastInfo.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: 42dceab20a12bc14da587223f4d76510 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 61 功能预设信息 #tagSCFuncPresetInfoList
|
| | |
|
| | | public class DTCB161_tagSCFuncPresetInfoList : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB161_tagSCFuncPresetInfoList vNetData = vNetPack as HB161_tagSCFuncPresetInfoList;
|
| | | FuncPresetManager.Instance.UpdateFuncPresetInfoList(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 62 功能预设切换信息 #tagSCFuncPresetSwitchInfo
|
| | |
|
| | | public class DTCB162_tagSCFuncPresetSwitchInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB162_tagSCFuncPresetSwitchInfo vNetData = vNetPack as HB162_tagSCFuncPresetSwitchInfo;
|
| | | FuncPresetManager.Instance.UpdateFuncPresetUseData(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B1 63 战斗预设切换信息 #tagSCBatPresetSwitchInfo
|
| | |
|
| | | public class DTCB163_tagSCBatPresetSwitchInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB163_tagSCBatPresetSwitchInfo vNetData = vNetPack as HB163_tagSCBatPresetSwitchInfo;
|
| | | FuncPresetManager.Instance.UpdateBatPresetNowUseInfo(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | Register(typeof(HA503_tagSCFamilyTaofaInfo), typeof(DTCA503_tagSCFamilyTaofaInfo)); |
| | | Register(typeof(HA504_tagSCFamilyTaofaAtkRet), typeof(DTCA504_tagSCFamilyTaofaAtkRet)); |
| | | Register(typeof(HB132_tagSCMinggeInfo), typeof(DTCB132_tagSCMinggeInfo)); |
| | | Register(typeof(HB161_tagSCFuncPresetInfoList), typeof(DTCB161_tagSCFuncPresetInfoList)); |
| | | Register(typeof(HB162_tagSCFuncPresetSwitchInfo), typeof(DTCB162_tagSCFuncPresetSwitchInfo)); |
| | | Register(typeof(HB163_tagSCBatPresetSwitchInfo), typeof(DTCB163_tagSCBatPresetSwitchInfo)); |
| | | Register(typeof(HA001_tagBroadCastInfo), typeof(DTCA001_tagBroadCastInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //A0 01 Gm广播消息#tagBroadCastInfo |
| | | |
| | | public class HA001_tagBroadCastInfo : GameNetPackBasic { |
| | | public uint StartTime; |
| | | public uint EndTime; |
| | | public ushort Interval; //时间间隔 |
| | | public ushort MsgLen; |
| | | public string Msg; //size = MsgLen |
| | | public byte IsDelOthers; //是否删除其他的 |
| | | |
| | | public HA001_tagBroadCastInfo () { |
| | | _cmd = (ushort)0xA001; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out StartTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out EndTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out Interval, vBytes, NetDataType.WORD); |
| | | TransBytes (out MsgLen, vBytes, NetDataType.WORD); |
| | | TransBytes (out Msg, vBytes, NetDataType.Chars, MsgLen); |
| | | TransBytes (out IsDelOthers, vBytes, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA0_Sys/HA001_tagBroadCastInfo.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: 8a5084f76f1b2d9469bcaebf5c3dbc79 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | for (int i = 0; i < PresetCnt; i ++) {
|
| | | PresetList[i] = new tagSCHeroPreset();
|
| | | TransBytes (out PresetList[i].PresetID, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PresetList[i].ShapeType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PresetList[i].HeroCnt, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PresetList[i].HeroItemIndexList, vBytes, NetDataType.WORD, PresetList[i].HeroCnt);
|
| | | }
|
| | |
| | |
|
| | | public class tagSCHeroPreset {
|
| | | public byte PresetID; //阵容方案预设ID
|
| | | public byte ShapeType; // 阵型
|
| | | public byte HeroCnt;
|
| | | public ushort[] HeroItemIndexList; // 所在武将背包索引+1列表 [站位1物品索引+1, 站位2, ...],站位无武将时为0
|
| | | }
|
| | |
| | | managers.Add(ViewNPCManager.Instance);
|
| | | managers.Add(EquipRecordManager.Instance);
|
| | | managers.Add(MinggeManager.Instance);
|
| | | managers.Add(FuncPresetManager.Instance);
|
| | | managers.Add(GMNotifyManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)); |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | |
| | | txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; |
| | |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)tagPlayerID, (int)enemyFace, (int)enemyFacePic)); |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)tagPlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | |
| | | txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; |
| | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaMatchInfo.PlayerID, (int)arenaMatchInfo.Face, (int)arenaMatchInfo.FacePic)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaMatchInfo.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | |
| | | txtName.text = UIHelper.ServerStringTrim(arenaMatchInfo.PlayerName); |
| | |
| | | //优先取进攻队伍的战力,没有进攻队伍,取主线战力 |
| | | public long GetMyFightPower() |
| | | { |
| | | var arenaDefenseTeam = TeamManager.Instance.GetTeam(TeamType.Arena); |
| | | var arenaDefenseTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Arena); |
| | | return arenaDefenseTeam.IsEmpty() || arenaDefenseTeam.GetTeamHeroCount() <= 0 ? |
| | | PlayerDatas.Instance.baseData.FightPower : |
| | | FightPowerManager.Instance.GetTeamFightPower(TeamType.Arena, false); |
| | | FightPowerManager.Instance.GetTeamFightPower(TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena), false); |
| | | } |
| | | } |
| | | |
| | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)rankData.id, (int)rankData.value3, (int)rankData.value4)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | nameText.text = rankData.name1; |
| | | rankValueText.text = string.Format(valueFormat, UIHelper.ReplaceLargeNum(rankData.cmpValue)); |
| | |
| | | { |
| | | queryPlayerBtn.AddListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo(viewPlayerId, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | } |
| | | } |
| | |
| | | model.Create(HorseManager.Instance.GetOtherPlayerHorseSkinID((int)rankData.value6), (int)rankData.value5, 1); |
| | | queryPlayerBtn.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)rankData.id, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | } |
| | | |
| | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)arenaGameRec.Value3, (int)arenaGameRec.Value5, (int)arenaGameRec.Value6)); |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)arenaGameRec.Value3, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | txtName.text = arenaGameRec.Name; |
| | | txtFightPoint.text = UIHelper.ReplaceLargeArtNum(arenaGameRec.FightPower); |
| | |
| | | }); |
| | | btnDeployTroops.SetListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectTeamType = TeamType.ArenaDefense; |
| | | HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena); |
| | | UIManager.Instance.OpenWindow<HeroPosWin>(1); // 竞技场标签页 |
| | | }); |
| | | } |
| | |
| | | enemyAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)info.PlayerID, (int)info.Face, (int)info.FacePic)); |
| | | enemyAvatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)TeamType.ArenaDefense); |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)info.PlayerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | var team = GetTeamHeroList(enemyTeam); |
| | | enemyCountry.RefreshOnTeamCountry(team, true); |
| | |
| | | base.OnTurnFightState(turnNum, State, FuncLineID, extendData); |
| | | } |
| | | |
| | | protected void OnTeamChange(TeamType teamType) |
| | | protected void OnTeamChange(int teamType) |
| | | { |
| | | if (teamType == TeamType.Story) |
| | | if (teamType == TeamManager.Instance.GetMainTeamID()) |
| | | { |
| | | if (battleState == StoryBattleState.Break) |
| | | { |
| | |
| | | |
| | | protected void ReloadTeam() |
| | | { |
| | | PreloadResources(new List<TeamBase>() { TeamManager.Instance.GetTeam(TeamType.Story) }, null); |
| | | battleObjMgr.ReloadTeam(TeamManager.Instance.GetTeam(TeamType.Story), BattleCamp.Red); |
| | | PreloadResources(new List<TeamBase>() { TeamManager.Instance.GetTeam(BattlePreSetType.Story) }, null); |
| | | battleObjMgr.ReloadTeam(TeamManager.Instance.GetTeam(BattlePreSetType.Story), BattleCamp.Red); |
| | | } |
| | | |
| | | // public override void OnBattleEnd(JsonData turnFightStateData) |
| | |
| | | { |
| | | var redTeamList = new List<TeamBase>(); |
| | | |
| | | TeamBase storyTeam = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | TeamBase storyTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Story); |
| | | |
| | | redTeamList.Add(storyTeam); |
| | | |
| | |
| | | bossHeadCell.SetTeamHero(teamHero); |
| | | txtBossName.text = teamHero.name; |
| | | NPCConfig npcConfig = NPCConfig.Get(teamHero.NPCID); |
| | | bossLifeBar.SetBaseInfo(Mathf.Max(1, npcConfig.LifeBarCount), (ulong)teamHero.curHp, (ulong)teamHero.maxHp); |
| | | //bossLifeBar.SetBaseInfo(Mathf.Max(1, npcConfig.LifeBarCount), (ulong)teamHero.curHp, (ulong)teamHero.maxHp); |
| | | bossBattleObject.buffMgr.onBuffChanged -= OnBuffChanged; |
| | | bossBattleObject.buffMgr.onBuffChanged += OnBuffChanged; |
| | | } |
| | |
| | | { |
| | | bossHeadCell.SetTeamHero(null); |
| | | txtBossName.text = string.Empty; |
| | | bossLifeBar.SetBaseInfo(2, 2, 2); |
| | | //bossLifeBar.SetBaseInfo(2, 2, 2); |
| | | Debug.LogError("找不到boss"); |
| | | } |
| | | |
| | |
| | | if (null != bossBattleObject) |
| | | { |
| | | TeamHero teamHero = bossBattleObject.teamHero; |
| | | bossLifeBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp); |
| | | //bossLifeBar.Show((ulong)teamHero.curHp, (ulong)teamHero.maxHp); |
| | | } |
| | | } |
| | | |
| | |
| | | // ★★★ 完全使用 StoryBossBattleWin 的逻辑 ★★★ |
| | | if (info.battleHurtParam.hurter.hurtObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.hurter.hurtObj.teamHero.ObjID) |
| | | { |
| | | bossLifeBar.Show((ulong)info.battleHurtParam.hurter.toHp, (ulong)bossBattleObject.teamHero.maxHp); |
| | | //bossLifeBar.Show((ulong)info.battleHurtParam.hurter.toHp, (ulong)bossBattleObject.teamHero.maxHp); |
| | | } |
| | | else if (info.battleHurtParam.caster.casterObj != null && bossBattleObject.teamHero.ObjID == info.battleHurtParam.caster.casterObj.teamHero.ObjID) |
| | | { |
| | | bossLifeBar.Show((ulong)info.battleHurtParam.caster.toHp, (ulong)bossBattleObject.teamHero.maxHp); |
| | | //bossLifeBar.Show((ulong)info.battleHurtParam.caster.toHp, (ulong)bossBattleObject.teamHero.maxHp); |
| | | } |
| | | } |
| | | |
| | |
| | | {
|
| | | uieff.effectId = 1026;
|
| | |
|
| | | uieff.PlayByArrIndex(equip.config.ItemColor - 7, true, true);
|
| | | uieff.PlayByArrIndex(equip.config.ItemColor - 7, true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | Debug.LogWarning("穿戴装备,向服务器请求"); |
| | | } |
| | | |
| | | //在记录销毁或替换前的装备 |
| | | //记录销毁或替换前的装备 |
| | | if ((opType == 1 || opType == 2) && !itemIndexList.IsNullOrEmpty()) |
| | | { |
| | | foreach (var index in itemIndexList) |
| | | { |
| | | var oldEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, index); |
| | | EquipRecordManager.Instance.oldEquipDic[index] = oldEquip; |
| | | ItemModel newEquip = PackManager.Instance.GetItemByIndex(PackType.DropItem, index); |
| | | if (newEquip == null) |
| | | continue; |
| | | int equipPlace = newEquip.config.EquipPlace - 1; |
| | | ItemModel oldEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, equipPlace); |
| | | EquipRecordManager.Instance.AddRecord(opType, newEquip, oldEquip); |
| | | } |
| | | } |
| | | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return equip.GetUseData(19); |
| | | } |
| | | |
| | | //技能ID列表 |
| | | public List<int> GetEquipSkillIDs(ItemModel equip) |
| | | { |
| | | if (equip == null) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return equip.GetUseData(37); |
| | | } |
| | | |
| | | //得到装备位对应的部位名称 |
| | | public string GetEquipPlaceName(int place) |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa86b940defc60440ac6c5e73d67dc70 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using System; |
| | | |
| | | //方案预设:流派设定 |
| | | // 这里存储的是流派id设定; 功能预设在各个功能里如命格的是存在命格背包对应,武将是另外通知使用的格子索引 |
| | | public class FuncPresetManager : GameSystemManager<FuncPresetManager> |
| | | { |
| | | //预设方案:功能类型(含全局和子功能,配表)-子方案ID-预设方案解锁名称信息 |
| | | Dictionary<int, Dictionary<int, FuncPreset>> m_FuncPresetDict = new Dictionary<int, Dictionary<int, FuncPreset>>(); |
| | | public event Action OnFuncPresetInfoListChanged; //流派设置总信息 |
| | | |
| | | //对应 BattlePreSetType 战斗类型 : 全局方案ID |
| | | Dictionary<int, int> battlePreSetDict = new Dictionary<int, int>(); |
| | | public event Action OnBattelePresetEvent; |
| | | |
| | | //所有预设方案的保存信息 全局方案ID :子功能类型(配表):子方案ID |
| | | Dictionary<int, Dictionary<int, int>> m_FuncPresetSaveDict = new Dictionary<int, Dictionary<int, int>>(); |
| | | public event Action OnFuncPresetUseDataEvent; |
| | | |
| | | public const int GlobalDefaultPresetID = 1; //默认全局方案ID |
| | | public const int FuncDefaultPresetID = 1; //默认子功能方案ID |
| | | |
| | | public int teamPresetMaxID = 1; //阵容预设最大ID, 默认1按解锁开放 |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize; |
| | | ParseConfig(); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | |
| | | void ParseConfig() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitialize() |
| | | { |
| | | battlePreSetDict.Clear(); |
| | | InitFuncPreset(); |
| | | } |
| | | |
| | | void InitFuncPreset() |
| | | { |
| | | m_FuncPresetDict.Clear(); |
| | | // if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Mingge)) |
| | | // { |
| | | // return; |
| | | // } |
| | | var keys = PresetUnlockConfig.GetKeys(); |
| | | for (int i = 0; i < keys.Count; i++) |
| | | { |
| | | var config = PresetUnlockConfig.Get(keys[i]); |
| | | if (!m_FuncPresetDict.ContainsKey(config.PresetType)) |
| | | { |
| | | m_FuncPresetDict[config.PresetType] = new Dictionary<int, FuncPreset>(); |
| | | } |
| | | m_FuncPresetDict[config.PresetType][config.PresetID] = new FuncPreset() |
| | | { |
| | | PresetID = config.PresetID, |
| | | unLock = config.UnlockType == 0, |
| | | PresetName = Language.Get("Mingge13") + config.PresetID, |
| | | }; |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | public void UpdateFuncPresetInfoList(HB161_tagSCFuncPresetInfoList vNetData) |
| | | { |
| | | for (int i = 0; i < vNetData.FuncCnt; i++) |
| | | { |
| | | var funcPresetInfo = vNetData.FuncPresetList[i]; |
| | | if (!m_FuncPresetDict.ContainsKey(funcPresetInfo.FuncPresetType)) |
| | | { |
| | | m_FuncPresetDict[funcPresetInfo.FuncPresetType] = new Dictionary<int, FuncPreset>(); |
| | | } |
| | | for (int j = 0; j < funcPresetInfo.PresetCnt; j++) |
| | | { |
| | | var preset = funcPresetInfo.PresetList[j]; |
| | | //该功能预设解锁状态,按预设ID二进制位运算记录是否已解锁 |
| | | m_FuncPresetDict[funcPresetInfo.FuncPresetType][preset.PresetID] = new FuncPreset() |
| | | { |
| | | PresetID = preset.PresetID, |
| | | unLock = (funcPresetInfo.UnlockState & (1 << preset.PresetID)) != 0, |
| | | PresetName = string.IsNullOrEmpty(preset.PresetName) ? Language.Get("Mingge13") + preset.PresetID : preset.PresetName, |
| | | }; |
| | | } |
| | | } |
| | | |
| | | OnFuncPresetInfoListChanged?.Invoke(); |
| | | } |
| | | |
| | | //每个全局方案的存储信息 |
| | | public void UpdateFuncPresetUseData(HB162_tagSCFuncPresetSwitchInfo vNetData) |
| | | { |
| | | for (int i = 0; i < vNetData.BatPresetCnt; i++) |
| | | { |
| | | var batPreset = vNetData.BatPresetList[i]; |
| | | if (!m_FuncPresetSaveDict.ContainsKey(batPreset.BatPresetID)) |
| | | { |
| | | m_FuncPresetSaveDict[batPreset.BatPresetID] = new Dictionary<int, int>(); |
| | | } |
| | | for (int j = 0; j < batPreset.FuncCnt; j++) |
| | | { |
| | | var funcPreset = batPreset.FuncPresetList[j]; |
| | | m_FuncPresetSaveDict[batPreset.BatPresetID][funcPreset.FuncPresetType] = funcPreset.FuncPresetID; |
| | | } |
| | | } |
| | | OnFuncPresetUseDataEvent?.Invoke(); |
| | | } |
| | | |
| | | //当前战斗功能的全局方案ID使用情况 |
| | | public void UpdateBatPresetNowUseInfo(HB163_tagSCBatPresetSwitchInfo netPack) |
| | | { |
| | | for (int i = 0; i < netPack.BatFuncCnt; i++) |
| | | { |
| | | battlePreSetDict[netPack.BatPresetList[i].BatPresetType] = netPack.BatPresetList[i].BatPresetID; |
| | | } |
| | | OnBattelePresetEvent?.Invoke(); |
| | | } |
| | | |
| | | //获取全局方案ID,如果取不到默认方案1 |
| | | public int GetGlobalPresetID(int type) |
| | | { |
| | | if (battlePreSetDict.ContainsKey(type)) |
| | | { |
| | | return battlePreSetDict[type]; |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | //获取子功能方案ID,如果取不到默认方案1 |
| | | public int GetFuncPresetID(int type, int presetID) |
| | | { |
| | | if (m_FuncPresetSaveDict.ContainsKey(presetID) && m_FuncPresetSaveDict[presetID].ContainsKey(type)) |
| | | { |
| | | return m_FuncPresetSaveDict[presetID][type]; |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | |
| | | public class FuncPreset |
| | | { |
| | | public int PresetID; //预设方案ID |
| | | public bool unLock; //是否解锁 |
| | | public string PresetName; //预设名称 |
| | | } |
| | | |
| | | |
| | | |
| | | //战斗功能区分对应存储全局方案ID,如演武场防守用哪个全局方案ID的分类 |
| | | public enum BattlePreSetType |
| | | { |
| | | None = 0, |
| | | Story = 1, //主线 |
| | | Arena = 2, //演武场防守 |
| | | |
| | | } |
| | | |
| | | //功能预设类型 1-全局战斗;2-阵容;3-命格; |
| | | public enum FuncPresetType |
| | | { |
| | | Global = 1, |
| | | Team = 2, |
| | | Mingge = 3, |
| | | } |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/FuncPreset/FuncPresetManager.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: a8f801f20f111f944bcd09b9bfa9c1b0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Text; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 修改公告界面 |
| | | /// </summary> |
| | | public class GuildChangeBroadcastWin : UIBase |
| | | { |
| | | [SerializeField] InputField inputField; |
| | | [SerializeField] Button okBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | okBtn.SetListener(() => |
| | | { |
| | | string msg = inputField.text; |
| | | if (!CheckLimit(msg, out int errorCode)) |
| | | { |
| | | ShowErrorTip(errorCode); |
| | | return; |
| | | } |
| | | SendPack(msg); |
| | | CloseWindow(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | inputField.text = string.Empty; |
| | | } |
| | | |
| | | private void SendPack(string msg) |
| | | { |
| | | CA623_tagCMChangeFamilyBroadcast pack = new CA623_tagCMChangeFamilyBroadcast(); |
| | | pack.Msg = msg; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | private bool CheckLimit(string info, out int errorCode) |
| | | { |
| | | errorCode = 0; |
| | | if (string.IsNullOrEmpty(info)) |
| | | { |
| | | errorCode = 0; |
| | | return false; |
| | | } |
| | | |
| | | if (SatisfyLength(info)) |
| | | { |
| | | errorCode = 1; |
| | | return false; |
| | | } |
| | | |
| | | if (DirtyWordConfig.IsDirtWord(info) || UIHelper.HasSpecCheckChat(info) || DirtyNameConfig.IsDirtName(info)) |
| | | { |
| | | errorCode = 3; |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private bool SatisfyLength(string name) |
| | | { |
| | | int length = Encoding.Default.GetBytes(name).Length; |
| | | int maxlength = inputField.characterLimit * 3; //纯中文字数 |
| | | return length > maxlength; |
| | | } |
| | | |
| | | private void ShowErrorTip(int _errorCode) |
| | | { |
| | | switch (_errorCode) |
| | | { |
| | | case 0: |
| | | //空 |
| | | SysNotifyMgr.Instance.ShowTip("ChatInfoNoNull"); |
| | | break; |
| | | case 1: |
| | | // 长度过长 |
| | | SysNotifyMgr.Instance.ShowTip("NameError2", inputField.characterLimit); |
| | | break; |
| | | case 3: |
| | | // 脏字 |
| | | SysNotifyMgr.Instance.ShowTip("NameSensitive"); |
| | | break; |
| | | } |
| | | } |
| | | } |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Guild/GuildChangeBroadcastWin.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: 2d13203d3d3b7204cb8063a9e13f605d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | var needLV = GuildManager.Instance.GetNeedGuildJobLV((int)GuildFuncType.PublishNotice); |
| | | if (PlayerDatas.Instance.fairyData.mine.FmLV >= needLV) |
| | | { |
| | | // UIManager.Instance.OpenWindow<GuildNoticeWin>(); |
| | | UIManager.Instance.OpenWindow<GuildChangeBroadcastWin>(); |
| | | } |
| | | }); |
| | | |
| | |
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateDonateRedPoint();
|
| | |
|
| | | QueryZBGFamilyInfo();
|
| | | }
|
| | |
|
| | | void PlayerDataRefreshEvent(PlayerDataType type)
|
| | |
| | | EnterOrQuitGuildEvent?.Invoke(false);
|
| | | }
|
| | |
|
| | | //注意上线通知公会数据时也会触发
|
| | | //注意上线通知公会数据时也会触发; 但断线重连不会触发
|
| | | public async UniTask AfterEnterGuild()
|
| | | {
|
| | | //这里还没有公会数据, 后续的包会更新公会数据
|
| | |
| | | //登录后首次打开查询,换新仙盟查询
|
| | | public void QueryZBGFamilyInfo()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.FamilyId == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (isQueryZBGYet)
|
| | | return;
|
| | |
|
| | |
|
| | | QueryFamilyAction((int)PlayerDatas.Instance.baseData.FamilyId, ZBGFamilyActionType);
|
| | |
|
| | | isQueryZBGYet = true;
|
| | |
| | | |
| | | |
| | | //不同阵容羁绊属性不同,实时计算,与其他缓存的不同 |
| | | public void RefreshFetterAttrsWhenCalcPower(TeamType teamType) |
| | | public void RefreshFetterAttrsWhenCalcPower(int teamType) |
| | | { |
| | | fetterAttrs.Clear(); |
| | | var list = GetActiveFetter(heroConfig, TeamManager.Instance.GetTeam(teamType)); |
| | |
| | | //阵容布阵 |
| | | public partial class HeroInfo |
| | | { |
| | | public Dictionary<TeamType, KeyValuePair<int, int>> GetTeamTypeShapeTypePositionDict() |
| | | public Dictionary<int, KeyValuePair<int, int>> GetTeamTypeShapeTypePositionDict() |
| | | { |
| | | // 英雄当前所有在的队伍 |
| | | List<int> heroTeams = itemHero.GetUseData(81); |
| | | |
| | | Dictionary<TeamType, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<TeamType, KeyValuePair<int, int>>(); |
| | | Dictionary<int, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<int, KeyValuePair<int, int>>(); |
| | | foreach (var teamMsg in heroTeams) |
| | | { |
| | | // 所在阵容信息列表 [阵容类型*10000+阵型类型*100+位置编号, ...] |
| | |
| | | int shapeType = (teamMsg % 10000) / 100; |
| | | int positionIndex = teamMsg % 100; |
| | | |
| | | if (teamTypeShapeTypePositionDict.ContainsKey((TeamType)teamType)) |
| | | if (teamTypeShapeTypePositionDict.ContainsKey(teamType)) |
| | | { |
| | | // 队伍类型相同,更新阵型和位置 |
| | | Debug.LogError("当前英雄拥有两个相同的队伍信息: " + teamType + " " + shapeType + " " + positionIndex + ", hero guid is " + itemHero.guid); |
| | |
| | | { |
| | | // 队伍类型不同,添加新的 |
| | | KeyValuePair<int, int> shapeTypePosition = new KeyValuePair<int, int>(shapeType, positionIndex); |
| | | teamTypeShapeTypePositionDict.Add((TeamType)teamType, shapeTypePosition); |
| | | teamTypeShapeTypePositionDict.Add(teamType, shapeTypePosition); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //是否上x阵 服务端队伍 |
| | | public bool IsInTeamByTeamType(TeamType teamType) |
| | | public bool IsInTeamByTeamType(BattlePreSetType battleType) |
| | | { |
| | | return TeamManager.Instance.GetTeam(teamType).HasHeroInServer(itemHero.guid); |
| | | return TeamManager.Instance.GetTeam(battleType).HasHeroInServer(itemHero.guid); |
| | | } |
| | | |
| | | //是否上任何阵容 |
| | | public bool IsInAnyTeam() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++) |
| | | { |
| | | if (TeamManager.Instance.GetTeam((TeamType)i).HasHeroInServer(itemHero.guid)) |
| | | if (TeamManager.Instance.GetTeam(i).HasHeroInServer(itemHero.guid)) |
| | | { |
| | | return true; |
| | | } |
| | |
| | | //是否上任何阵容,且只有一只 |
| | | public bool IsInAnyTeamJustOne() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++) |
| | | { |
| | | var team = TeamManager.Instance.GetTeam((TeamType)i); |
| | | var team = TeamManager.Instance.GetTeam(i); |
| | | if (team.HasHeroInServer(itemHero.guid)) |
| | | { |
| | | if (team.GetTeamHeroCount() == 1) |
| | |
| | | //下阵所有阵容 |
| | | public void LeaveAllTeam() |
| | | { |
| | | for (int i = 1; i < (int)TeamType.Max; i++) |
| | | for (int i = 1; i < FuncPresetManager.Instance.teamPresetMaxID; i++) |
| | | { |
| | | int pos; |
| | | var team = TeamManager.Instance.GetTeam((TeamType)i); |
| | | if (TeamManager.Instance.GetTeam((TeamType)i).RemoveHero(this, out pos)) |
| | | var team = TeamManager.Instance.GetTeam(i); |
| | | if (TeamManager.Instance.GetTeam(i).RemoveHero(this, out pos)) |
| | | { |
| | | //如果是最后一个武将,则默认上阵一个 |
| | | team.SaveTeam(); |
| | |
| | | countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country)); |
| | | jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class)); |
| | | heroModel.Create(heroConfig.SkinIDList[hero.SkinIndex], heroConfig.UIScale); |
| | | onStateImg.SetActive(hero.IsInTeamByTeamType(TeamType.Story)); |
| | | onStateImg.SetActive(hero.IsInTeamByTeamType(BattlePreSetType.Story)); |
| | | |
| | | int teamPos = TeamManager.Instance.GetTeam(TeamType.Story).GetPosition(hero.itemHero.guid); |
| | | int teamPos = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetPosition(hero.itemHero.guid); |
| | | if (teamPos >= 0) |
| | | { |
| | | redpoint.redpointId = MainRedDot.HeroCardRedpoint * 10 + teamPos; |
| | |
| | | } |
| | | } |
| | | |
| | | void OnTeamChange(TeamType type) |
| | | void OnTeamChange(int type) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | |
| | | HeroGiftRoleListCell heroGiftRoleListCell = cellView as HeroGiftRoleListCell; |
| | | heroGiftRoleListCell.Display(cellView.index); |
| | | } |
| | | void OnTeamChange(TeamType type) |
| | | void OnTeamChange(int type) |
| | | { |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | |
| | | }); |
| | | changeHeroPosBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectTeamType = TeamType.Story; |
| | | HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID(); |
| | | UIManager.Instance.OpenWindow<HeroPosWin>(); |
| | | }); |
| | | attrOnTipBtn.AddListener(() => |
| | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | attackTeamBtn.AddListener(() => |
| | | { |
| | | SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(0)); |
| | | }); |
| | | defendTeamBtn.AddListener(() => |
| | | { |
| | | SelectTeamFunc((TeamType)HeroUIManager.Instance.GetSelectTeamTypeByAttackType(1)); |
| | | }); |
| | | |
| | | mainFBBtn.AddListener(() => |
| | | { |
| | | SelectTeamFunc(TeamType.Story); |
| | | SelectTeamFunc(TeamManager.Instance.GetMainTeamID()); |
| | | }); |
| | | |
| | | jjcBtn.AddListener(() => |
| | | { |
| | | SelectTeamFunc(TeamType.Arena); |
| | | SelectTeamFunc(TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena)); |
| | | }); |
| | | // tttBtn.AddListener(() => |
| | | // { |
| | |
| | | //管理布阵入口按钮:如竞技场是否根据功能显隐,通天塔和主线只有进攻方布阵默认不显示 |
| | | void RefreshOnTeamBtn() |
| | | { |
| | | if (HeroUIManager.Instance.selectTeamType == TeamType.Arena || |
| | | HeroUIManager.Instance.selectTeamType == TeamType.ArenaDefense) |
| | | { |
| | | attackTeamBtn.SetActive(true); |
| | | defendTeamBtn.SetActive(true); |
| | | if (HeroUIManager.Instance.selectTeamType == TeamType.Arena) |
| | | { |
| | | attackTeamBtn.SelectBtn(true); |
| | | } |
| | | else |
| | | { |
| | | defendTeamBtn.SelectBtn(true); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | attackTeamBtn.SetActive(false); |
| | | defendTeamBtn.SetActive(false); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | team.SaveTeam(); |
| | | } |
| | | |
| | | void SelectTeamFunc(TeamType type) |
| | | void SelectTeamFunc(int type) |
| | | { |
| | | if (HeroUIManager.Instance.selectTeamType == type) |
| | | { |
| | |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | protected void OnTeamChange(TeamType teamType) |
| | | protected void OnTeamChange(int teamType) |
| | | { |
| | | if (HeroUIManager.Instance.selectTeamType == teamType) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | void TeamPosChangeEvent(TeamType teamType) |
| | | void TeamPosChangeEvent(int teamType) |
| | | { |
| | | if (teamType != TeamType.Story) |
| | | if (teamType != TeamManager.Instance.GetMainTeamID()) |
| | | return; |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(hero.CalculateFightPower()); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | if (!hero.IsInTeamByTeamType(TeamType.Story)) |
| | | if (!hero.IsInTeamByTeamType(BattlePreSetType.Story)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | #region 布阵界面 |
| | | public List<string> heroOnTeamSortList { get; private set; } = new List<string>(); //不同上阵的列表排序 |
| | | |
| | | private TeamType m_SelectTeamType = TeamType.Story; //当前选中的是哪个阵容, 布阵相关逻辑使用 |
| | | public TeamType selectTeamType |
| | | private int m_SelectTeamType = 1; //当前选中的是哪个全局方案ID, 布阵相关逻辑使用 |
| | | public int selectTeamType |
| | | { |
| | | get { return m_SelectTeamType; } |
| | | set |
| | |
| | | if (m_SelectTeamType == value) |
| | | return; |
| | | //上一个阵容需要恢复到原状态 |
| | | if (m_SelectTeamType != TeamType.None) |
| | | if (m_SelectTeamType != 0) |
| | | { |
| | | TeamManager.Instance.GetTeam(m_SelectTeamType).RestoreTeam(); |
| | | } |
| | |
| | | m_SelectTeamType = value; |
| | | } |
| | | } |
| | | |
| | | public int setlectTabIndex = 0; //战斗总标签 对应 BattlePreSetType |
| | | |
| | | public List<int> selectListTeamPos = new List<int>(); //布阵界面 筛选条件 |
| | | |
| | |
| | | /// <summary> |
| | | /// 按队伍获得阵型(国家光环)属性 |
| | | /// </summary> |
| | | /// <param name="teamType"></param> |
| | | /// <param name="isPreview">true 客户端预览阵容,默认false 服务器阵容</param> |
| | | /// <returns></returns> |
| | | public Dictionary<int, int> GetCountryAttrs(TeamType teamType, bool isPreview = false) |
| | | public Dictionary<int, int> GetCountryAttrs(int teamType, bool isPreview = false) |
| | | { |
| | | Dictionary<int, int> countryAttrs = new Dictionary<int, int>(); |
| | | Int2 result = GetMaxCountHeroCountry(teamType, isPreview); |
| | |
| | | /// <param name="teamType"></param> |
| | | /// <param name="isPreview">true 客户端预览阵容,默认false 服务器阵容</param> |
| | | /// <returns></returns> |
| | | public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamType(TeamType teamType, bool isPreview = false) |
| | | public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamType(int teamType, bool isPreview = false) |
| | | { |
| | | Dictionary<HeroCountry, int> heroCountryCount = new Dictionary<HeroCountry, int>(); |
| | | |
| | |
| | | /// <param name="teamType"></param> |
| | | /// <param name="isPreview">true 客户端预览阵容,默认false 服务器阵容</param> |
| | | /// <returns></returns> |
| | | public Int2 GetMaxCountHeroCountry(TeamType teamType, bool isPreview = false) |
| | | public Int2 GetMaxCountHeroCountry(int teamType, bool isPreview = false) |
| | | { |
| | | var countryCountDict = GetCountryHeroCountByTeamType(teamType, isPreview); |
| | | //找到最大的国家和数量 |
| | |
| | | } |
| | | } |
| | | return new Int2((int)country, maxValue); |
| | | } |
| | | |
| | | //在不同页签下选AttackType 0 攻击阵容 1 防守阵容 |
| | | public int GetSelectTeamTypeByAttackType(int AttackType) |
| | | { |
| | | if (selectTeamType == TeamType.Arena || selectTeamType == TeamType.ArenaDefense) |
| | | { |
| | | return AttackType == 0 ? (int)TeamType.Arena : (int)TeamType.ArenaDefense; |
| | | } |
| | | |
| | | |
| | | return (int)TeamType.Story; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | int minLV = int.MaxValue; |
| | | int minID = -1; |
| | | var team = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | var team = TeamManager.Instance.GetTeam(TeamManager.Instance.GetMainTeamID()); |
| | | for (int i = 0; i < team.serverHeroes.Length; i++) |
| | | { |
| | | if (team.serverHeroes[i] != null) |
| | |
| | | } |
| | | |
| | | // 排序规则:上阵>武将等级>突破等级>武将觉醒阶级>武将品质>武将吞噬星级>武将ID |
| | | bool isInTeamA = heroA.IsInTeamByTeamType(TeamType.Story); |
| | | bool isInTeamB = heroB.IsInTeamByTeamType(TeamType.Story); |
| | | bool isInTeamA = heroA.IsInTeamByTeamType(BattlePreSetType.Story); |
| | | bool isInTeamB = heroB.IsInTeamByTeamType(BattlePreSetType.Story); |
| | | if (isInTeamA != isInTeamB) |
| | | { |
| | | return isInTeamA ? -1 : 1; |
| | |
| | | return 0; |
| | | |
| | | var heroCnt = PackManager.Instance.GetItemCountByID(PackType.Hero, hero.heroId); |
| | | if (!hero.IsInTeamByTeamType(TeamType.Story)) |
| | | if (!hero.IsInTeamByTeamType(BattlePreSetType.Story)) |
| | | { |
| | | if (hero.heroStar < hero.GetCurMaxStar() && heroCnt > 1) |
| | | { |
| | |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Hero)) |
| | | return; |
| | | |
| | | var team = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | var team = TeamManager.Instance.GetTeam(BattlePreSetType.Story); |
| | | for (int i = 0; i < heroOnTeamRedpointList.Count; i++) |
| | | { |
| | | var redpoint = heroOnTeamRedpointList[i]; |
| | |
| | | } |
| | | } |
| | | |
| | | void OnTeamChangeEvent(TeamType teamType) |
| | | void OnTeamChangeEvent(int teamType) |
| | | { |
| | | if (teamType == TeamType.Story) |
| | | if (teamType == TeamManager.Instance.GetMainTeamID()) |
| | | { |
| | | refreshRedPoint = true; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | TeamBase storyTeam = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | TeamBase storyTeam = TeamManager.Instance.GetTeam(BattlePreSetType.Story); |
| | | storyTeam.RemoveAllHeroes(); |
| | | |
| | | int currentMaxLineupCount = TeamConst.MaxTeamHeroCount - HeroUIManager.Instance.lockIndexList.Count; |
| | |
| | | |
| | | fightingHeroSkinID = teamHero.SkinID; |
| | | //战斗时没有GUID ,通过heroid查找 |
| | | var hero = TeamManager.Instance.GetTeam(TeamType.Story).GetHeroByHeroID(teamHero.heroId); |
| | | var hero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetHeroByHeroID(teamHero.heroId); |
| | | if (hero != null) |
| | | { |
| | | heroGuid = hero.guid; |
| | |
| | | |
| | | [SerializeField] Toggle autoFinishTaskToggle; |
| | | [SerializeField] Button autoFinishTaskTipBtn; |
| | | |
| | | [SerializeField] Button recordBtn; |
| | | bool isOpenCostScroll = false; |
| | | bool isOpenSpeedScroll = false; |
| | | bool isOpenTryChallengeScroll = false; |
| | |
| | | |
| | | autoFinishTaskTipBtn.AddListener(() => |
| | | { |
| | | DislayTip("AutoFight16",autoFinishTaskTipBtn.transform.position); |
| | | DislayTip("AutoFight16", autoFinishTaskTipBtn.transform.position); |
| | | }); |
| | | |
| | | changeCostBtn.AddListener(() => |
| | |
| | | isOpenTryChallengeScroll = false; |
| | | tryChallengeArrow.transform.localRotation = Quaternion.Euler(0, 0, 0); |
| | | }); |
| | | |
| | | recordBtn.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<EquipRecordWin>(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | using System; |
| | | public class EquipRecordCell : MonoBehaviour |
| | | { |
| | | [SerializeField] EquipRecordItem fromEquip; |
| | | [SerializeField] EquipRecordItem toEquip; |
| | | [SerializeField] ImageEx imgWear; |
| | | [SerializeField] ImageEx imgDecompose; |
| | | public void Display(int index) |
| | | [SerializeField] TextEx txtFightPoint; |
| | | [SerializeField] TextEx txtTime; |
| | | public void Display(int index, List<EquipRecordManager.EquipRecordData> list) |
| | | { |
| | | if (list == null || index >= list.Count || index < 0) |
| | | return; |
| | | var data = list[index]; |
| | | int state = GetState(data); |
| | | if (state == 0) |
| | | { |
| | | fromEquip.SetActive(false); |
| | | toEquip.SetActive(false); |
| | | imgWear.SetActive(false); |
| | | imgDecompose.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | fromEquip.SetActive(state == 1 || state == 2 || state == 3); |
| | | toEquip.SetActive(state == 1); |
| | | imgDecompose.SetActive(state == 2); |
| | | imgWear.SetActive(state == 3); |
| | | fromEquip.Display(state == 1 ? data.oldEquip : data.newEquip); |
| | | toEquip.Display(data.newEquip); |
| | | } |
| | | txtFightPoint.text = StringUtility.Concat("+", UIHelper.ReplaceLargeNum(data.fightPower)); |
| | | txtTime.text = GetTime(data.timestamp); |
| | | } |
| | | |
| | | // 0-不显示 1-交换 2-分解 3-首次穿装备 |
| | | private int GetState(EquipRecordManager.EquipRecordData data) |
| | | { |
| | | if (data == null || data.newEquip == null) |
| | | return 0; |
| | | if (data.oldEquip == null) |
| | | return 3; |
| | | if (data.recordType == (int)EquipRecordManager.EquipOPType.Equip) |
| | | return 1; |
| | | if (data.recordType == (int)EquipRecordManager.EquipOPType.Decompose) |
| | | return 2; |
| | | return 0; |
| | | } |
| | | |
| | | private string GetTime(int timestamp) |
| | | { |
| | | DateTime dateTime = TimeUtility.GetTime((uint)timestamp); |
| | | return dateTime.ToString("MM-dd HH:mm:ss"); |
| | | } |
| | | } |
| | |
| | | [SerializeField] TextEx txtLV; |
| | | public void Display(EquipRecordManager.EquipDetail detail) |
| | | { |
| | | if (detail == null || !ItemConfig.HasKey(detail.itemId)) |
| | | return; |
| | | var config = ItemConfig.Get(detail.itemId); |
| | | |
| | | string name = config.ItemName; |
| | | int quality = config.ItemColor; |
| | | string IconKey = config.IconKey; |
| | | imgEquip.SetOrgSprite(IconKey); |
| | | txtName.text = UIHelper.AppendColor(quality, name, true, 1); |
| | | txtQualityName.text = UIHelper.GetQualityNameWithColor(quality, Language.Get("L1039")); |
| | | itemNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality); |
| | | qualityNameOutline.OutlineColor = UIHelper.GetUIOutlineColor(quality); |
| | | txtLV.text = Language.Get("L1113", detail.lv); |
| | | imgQuality.SetSprite("equipQuality" + quality); |
| | | } |
| | | |
| | | } |
| | |
| | | public class EquipRecordManager : GameSystemManager<EquipRecordManager> |
| | | { |
| | | private List<EquipRecordData> recordList = new List<EquipRecordData>(); |
| | | public Dictionary<int, ItemModel> oldEquipDic = new Dictionary<int, ItemModel>(); |
| | | |
| | | /// <summary> |
| | | /// 调试用:遍历输出所有装备记录的详细信息(单条Log) |
| | | /// </summary> |
| | | public void DebugLogAllRecords() |
| | | { |
| | | var sb = new System.Text.StringBuilder(); |
| | | sb.AppendLine($"=== 装备记录总数: {recordList.Count} | 旧装备字典条目数: {oldEquipDic.Count} ==="); |
| | | |
| | | for (int i = 0; i < recordList.Count; i++) |
| | | { |
| | | var record = recordList[i]; |
| | | sb.AppendLine($"--- 记录 {i + 1} ---"); |
| | | sb.AppendLine($"记录ID: {record.recordId} | 时间: {TimeUtility.GetTime((uint)record.timestamp)} | 类型: {record.recordType}"); |
| | | |
| | | // 新装备详情 |
| | | if (record.newEquip != null) |
| | | { |
| | | sb.AppendLine($"[新装备] ID:{record.newEquip.itemId} | 名称:{record.newEquip.itemName} | 强化:{record.newEquip.level} | 评分:{record.newEquip.score} | 部位:{record.newEquip.equipPlace} | 战力:{record.newEquip.fightPower} | GUID:{record.newEquip.guid}"); |
| | | } |
| | | else |
| | | { |
| | | sb.AppendLine($"[新装备] 无数据"); |
| | | } |
| | | |
| | | // 旧装备详情 |
| | | if (record.oldEquip != null) |
| | | { |
| | | sb.AppendLine($"[旧装备] ID:{record.oldEquip.itemId} | 名称:{record.oldEquip.itemName} | 强化:{record.oldEquip.level} | 评分:{record.oldEquip.score} | 部位:{record.oldEquip.equipPlace} | 战力:{record.oldEquip.fightPower} | GUID:{record.oldEquip.guid}"); |
| | | } |
| | | else |
| | | { |
| | | sb.AppendLine($"[旧装备] 无数据"); |
| | | } |
| | | |
| | | sb.AppendLine(); // 空行分隔 |
| | | } |
| | | |
| | | // 旧装备字典 |
| | | sb.AppendLine("=== 旧装备字典详情 ==="); |
| | | foreach (var kvp in oldEquipDic) |
| | | { |
| | | sb.AppendLine($"Key:{kvp.Key} | Value:ItemModel(itemId={kvp.Value?.itemId}, guid={kvp.Value?.guid})"); |
| | | } |
| | | |
| | | UnityEngine.Debug.Log(sb.ToString()); |
| | | } |
| | | |
| | | |
| | | |
| | | private int maxCnt; |
| | | public int maxCnt; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | // 监听装备操作结果 |
| | | EquipModel.Instance.OnEquipOPResultAction += OnEquipOPResult; |
| | | |
| | | var config = FuncConfigConfig.Get("AutoGuaji1"); |
| | | maxCnt = int.Parse(config.Numerical5); |
| | |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | EquipModel.Instance.OnEquipOPResultAction -= OnEquipOPResult; |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void OnPlayerLoginOk() |
| | |
| | | private void LoadRecords() |
| | | { |
| | | var json = LocalSave.GetString(Key); |
| | | if (!string.IsNullOrEmpty(json)) |
| | | if (string.IsNullOrEmpty(json)) |
| | | { |
| | | recordList = new List<EquipRecordData>(); |
| | | return; |
| | | } |
| | | |
| | | try |
| | | { |
| | | recordList = JsonMapper.ToObject<List<EquipRecordData>>(json); |
| | | // 排序规则:时间戳小的靠前,时间戳相同则索引小的靠前 |
| | | recordList.Sort((a, b) => |
| | | { |
| | | int timeCompare = a.timestamp.CompareTo(b.timestamp); |
| | | if (timeCompare != 0) |
| | | return timeCompare; |
| | | return 0; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 装备操作结果回调 - 记录装备变化 |
| | | /// </summary> |
| | | /// <param name="isDone">是否成功更换</param> |
| | | /// <param name="equipIndex">装备栏索引</param> |
| | | private void OnEquipOPResult(bool isDone, int equipIndex) |
| | | { |
| | | if (equipIndex < 0) return; |
| | | |
| | | // 获取新装备和旧装备信息 |
| | | var newEquip = PackManager.Instance.GetItemByIndex(PackType.Equip, equipIndex); |
| | | if (newEquip == null) return; |
| | | |
| | | // 获取被替换的装备(需要从其他地方记录) |
| | | // 这里需要配合 EquipModel 的 OnEquipResult 记录被替换的装备 |
| | | // ... |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"加载装备记录失败: {ex.Message}"); |
| | | recordList = new List<EquipRecordData>(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var detail = new EquipDetail |
| | | { |
| | | itemId = item.itemId, |
| | | level = item.GetUseDataFirstValue(22), |
| | | equipPlace = item.config.EquipPlace, |
| | | lv = item.GetUseDataFirstValue(22), |
| | | guid = item.guid, |
| | | }; |
| | | return detail; |
| | | } |
| | | |
| | | public List<EquipRecordData> GetRecordList(bool isSort = false) |
| | | { |
| | | if (recordList == null) |
| | | { |
| | | return null; |
| | | } |
| | | if (isSort) |
| | | { |
| | | // 排序规则:时间戳小的靠前,时间戳相同则索引小的靠前 |
| | | recordList.Sort((a, b) => |
| | | { |
| | | int timeCompare = a.timestamp.CompareTo(b.timestamp); |
| | | if (timeCompare != 0) |
| | | return timeCompare; |
| | | return 0; |
| | | }); |
| | | } |
| | | return recordList; |
| | | } |
| | | |
| | | public event Action OnUpdateRecordListEvent; |
| | | |
| | | public void AddRecord(int recordType, ItemModel newEquip, ItemModel oldEquip) |
| | | { |
| | | if (newEquip == null) |
| | | return; |
| | | long showFightPower = FightPowerManager.Instance.GetFightPowerChange(newEquip); |
| | | // 新装备战力低于旧装备战力,不允许添加 |
| | | if (showFightPower <= 0) |
| | | return; |
| | | |
| | | var newDetail = GetEquipDetail(newEquip); |
| | | var oldDetail = GetEquipDetail(oldEquip); |
| | | |
| | | if (recordList == null) |
| | | return; |
| | | |
| | | // 遍历现有记录,检查是否存在匹配的记录(不限制顺序) |
| | | foreach (var existingRecord in recordList) |
| | | { |
| | | if (IsSameRecord(existingRecord, newDetail, oldDetail)) |
| | | { |
| | | // 找到匹配的记录,不添加 |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var record = new EquipRecordData |
| | | { |
| | | recordType = (int)recordType, |
| | | newEquip = GetEquipDetail(newEquip), |
| | | oldEquip = GetEquipDetail(oldEquip), |
| | | fightPower = showFightPower, |
| | | timestamp = TimeUtility.AllSeconds, |
| | | }; |
| | | |
| | | if (recordList.Count >= maxCnt) |
| | | { |
| | | // 移除最早加入的记录(排序后第一个) |
| | | recordList.RemoveAt(0); |
| | | } |
| | | |
| | | recordList.Add(record); |
| | | SaveRecords(); |
| | | OnUpdateRecordListEvent?.Invoke(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断两条记录是否一致(不限制 new/old 顺序) |
| | | /// </summary> |
| | | private bool IsSameRecord(EquipRecordData existingRecord, EquipDetail newDetail, EquipDetail oldDetail) |
| | | { |
| | | // 参数校验 |
| | | if (newDetail == null && oldDetail == null) |
| | | return true; |
| | | if (existingRecord == null) |
| | | return true; |
| | | |
| | | // 计算各字段是否为 null |
| | | bool newIsNull = IsNullOrEmptyGuid(newDetail); |
| | | bool oldIsNull = IsNullOrEmptyGuid(oldDetail); |
| | | bool recordNewIsNull = IsNullOrEmptyGuid(existingRecord.newEquip); |
| | | bool recordOldIsNull = IsNullOrEmptyGuid(existingRecord.oldEquip); |
| | | |
| | | // 如果两边都为空,则视为相同 |
| | | if (newIsNull && oldIsNull && recordNewIsNull && recordOldIsNull) |
| | | return true; |
| | | |
| | | // 如果只有一边为空,则不同 |
| | | if (newIsNull != recordNewIsNull || oldIsNull != recordOldIsNull) |
| | | return false; |
| | | |
| | | // 检查顺序是否匹配 |
| | | bool orderMatch = IsGuidMatch(existingRecord.newEquip, newDetail) && |
| | | IsGuidMatch(existingRecord.oldEquip, oldDetail); |
| | | |
| | | // 检查顺序是否相反 |
| | | bool reverseMatch = IsGuidMatch(existingRecord.newEquip, oldDetail) && |
| | | IsGuidMatch(existingRecord.oldEquip, newDetail); |
| | | |
| | | return orderMatch || reverseMatch; |
| | | } |
| | | |
| | | // 判断装备详情是否为 null 或 guid 为空 |
| | | private bool IsNullOrEmptyGuid(EquipDetail detail) |
| | | { |
| | | return detail == null || string.IsNullOrEmpty(detail.guid); |
| | | } |
| | | |
| | | // 比较两个装备详情的 guid 是否相等(安全比较,避免 null 异常) |
| | | private bool IsGuidMatch(EquipDetail a, EquipDetail b) |
| | | { |
| | | // 任一对象为 null 则不匹配 |
| | | if (a == null || b == null) |
| | | return false; |
| | | |
| | | return a.guid == b.guid; |
| | | } |
| | | |
| | | // 装备记录数据类型 |
| | | public class EquipRecordData |
| | | { |
| | | public string recordId; // 记录唯一ID |
| | | public long timestamp; // 时间戳 |
| | | public RecordType recordType; // 记录类型 |
| | | public int recordType; // 记录类型 |
| | | public EquipDetail newEquip; // 新装备详情 |
| | | public EquipDetail oldEquip; // 旧装备详情 |
| | | |
| | | public long fightPower; // 战力差 |
| | | public int timestamp; // 时间戳 |
| | | } |
| | | |
| | | public class EquipDetail |
| | | { |
| | | public int itemId; // 物品配置ID |
| | | public string itemName; // 物品名称 |
| | | public int level; // 强化等级 |
| | | public int score; // 装备评分 |
| | | public int equipPlace; // 装备部位 |
| | | public long fightPower; // 战力 |
| | | public string guid; // 装备唯一ID |
| | | public string guid; // 装备唯一ID |
| | | public int itemId; // 物品ID |
| | | public int lv; // 等级 |
| | | } |
| | | |
| | | public enum RecordType |
| | | |
| | | public enum EquipOPType |
| | | { |
| | | Equip = 0, // 装备 |
| | | Decompose = 1 // 分解 |
| | | Decompose = 1, // 分解 |
| | | Equip = 2, // 装备 |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class EquipRecordWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | [SerializeField] Transform transNo; |
| | | [SerializeField] TextEx txtTip; |
| | | EquipRecordManager manager { get { return EquipRecordManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | | CreateScroller(); |
| | | manager.OnUpdateRecordListEvent += OnUpdateRecordListEvent; |
| | | txtTip.text = Language.Get("AutoFight17", manager.maxCnt); |
| | | scroller.lockType = EnhanceLockType.KeepVertical; |
| | | CreateScroller(isSort: true, isjump: true); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | manager.OnUpdateRecordListEvent -= OnUpdateRecordListEvent; |
| | | } |
| | | |
| | | private void OnUpdateRecordListEvent() |
| | | { |
| | | CreateScroller(); |
| | | } |
| | | |
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<EquipRecordCell>(); |
| | | _cell?.Display(cell.index); |
| | | _cell?.Display(cell.index, list); |
| | | } |
| | | private void CreateScroller() |
| | | List<EquipRecordManager.EquipRecordData> list; |
| | | |
| | | private void CreateScroller(bool isSort = false, bool isjump = false) |
| | | { |
| | | scroller.Refresh(); |
| | | |
| | | for (int i = 0; i < 20; i++) |
| | | list = manager.GetRecordList(isSort); |
| | | bool isNullOrEmpty = list.IsNullOrEmpty(); |
| | | transNo.SetActive(isNullOrEmpty); |
| | | if (!isNullOrEmpty) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | for (int i = list.Count - 1; i >= 0; i--) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scroller.Restart(); |
| | | if (isjump) |
| | | { |
| | | scroller.JumpIndex(0); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | #region 初始化战力计算的信息 |
| | | TeamType teamTypeCalc = TeamType.Story; //不同阵容战力不同 |
| | | int teamTypeCalc = 1; //不同阵容战力不同 |
| | | bool isPreviewTeamPower; //预览阵容(队伍)战力 |
| | | int dropIndexCalc = -1; //掉落装备在阵容的索引,用于预览战力对比 |
| | | |
| | |
| | | /// <param name="teamType">阵容类型</param> |
| | | /// <param name="dropindex">掉落装备的索引,-1代表不替换计算</param> |
| | | /// <param name="ispreview">预览阵容战力</param> |
| | | public void InitFightPowerParam(TeamType teamType = TeamType.Story, int dropindex = -1, bool ispreview = false) |
| | | public void InitFightPowerParam(int teamType = 1, int dropindex = -1, bool ispreview = false) |
| | | { |
| | | #if !UNITY_EDITOR |
| | | openLog = false; |
| | |
| | | public long GetHeroFightPower(HeroInfo heroInfo) |
| | | { |
| | | bool ispreview = false; |
| | | var team = TeamManager.Instance.GetTeam(TeamType.Story); |
| | | var team = TeamManager.Instance.GetTeam(TeamManager.Instance.GetMainTeamID()); |
| | | if (!team.HasHero(heroInfo.itemHero.guid)) |
| | | { |
| | | //替换上阵位置 |
| | |
| | | |
| | | |
| | | //查看阵容战力 |
| | | public long GetTeamFightPower(TeamType team, bool isPreview) |
| | | public long GetTeamFightPower(int team, bool isPreview) |
| | | { |
| | | InitFightPowerParam(team, -1, isPreview); |
| | | return CalculatePower(); |
| | |
| | | { |
| | | |
| | | Dictionary<int, long> tmpAttrs = new Dictionary<int, long>(); |
| | | hero.RefreshFetterAttrsWhenCalcPower(TeamType.Story); //羁绊属性要实时算 |
| | | hero.RefreshFetterAttrsWhenCalcPower(TeamManager.Instance.GetMainTeamID()); //羁绊属性要实时算 |
| | | |
| | | #if UNITY_EDITOR |
| | | propertyStrForDebug = ""; |
| | |
| | | |
| | | changeHeroPosBtn.AddListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectTeamType = TeamType.Story; |
| | | HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID(); |
| | | UIManager.Instance.OpenWindow<HeroPosWin>(); |
| | | }); |
| | | |
| | |
| | | RefreshRecharge(); |
| | | ShowBlessLV(); |
| | | DisplayAutoFight(); |
| | | DisplayCard(TeamType.Story); |
| | | DisplayCard(TeamManager.Instance.GetMainTeamID()); |
| | | DisplayLevel(); |
| | | DisplayRestState(); |
| | | |
| | |
| | | TaskManager.Instance.ClickTask(); |
| | | } |
| | | |
| | | void DisplayCard(TeamType teamType) |
| | | void DisplayCard(int presetID) |
| | | { |
| | | if (teamType != TeamType.Story) |
| | | if (presetID != TeamManager.Instance.GetMainTeamID()) |
| | | return; |
| | | var team = TeamManager.Instance.GetTeam(teamType); |
| | | var team = TeamManager.Instance.GetTeam(presetID); |
| | | var heros = team.GetHerosOnTeam(); |
| | | //显示卡牌 |
| | | for (int i = 0; i < heroFightingCardCells.Length; i++) |
| | |
| | | //其他武将功能产生数据变化,需要刷新武将列表 |
| | | if (closeUI is HeroTrainWin) |
| | | { |
| | | DisplayCard(TeamType.Story); |
| | | DisplayCard(TeamManager.Instance.GetMainTeamID()); |
| | | } |
| | | |
| | | if (closeUI is ChatWin) |
| | |
| | | |
| | | void OnUnLockHeroCountEvent() |
| | | { |
| | | DisplayCard(TeamType.Story); |
| | | DisplayCard(TeamManager.Instance.GetMainTeamID()); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | if (string.IsNullOrEmpty(guid)) |
| | | { |
| | | var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(""); |
| | | var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero(""); |
| | | if (tmpHero != null) |
| | | { |
| | | AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID; |
| | |
| | | cdTween.SetStartState(); |
| | | cdTween.Play(() => |
| | | { |
| | | var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid); |
| | | var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid); |
| | | if (tmpHero != null) |
| | | { |
| | | AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID; |
| | |
| | | |
| | | if (AutoFightModel.Instance.fightingHeroSkinID == 0) |
| | | { |
| | | var tmpHero = TeamManager.Instance.GetTeam(TeamType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid); |
| | | var tmpHero = TeamManager.Instance.GetTeam(BattlePreSetType.Story).GetNextServerHero(AutoFightModel.Instance.heroGuid); |
| | | if (tmpHero != null) |
| | | { |
| | | AutoFightModel.Instance.fightingHeroSkinID = tmpHero.SkinID; |
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (hero.IsInTeamByTeamType(TeamType.Story))
|
| | | if (hero.IsInTeamByTeamType(BattlePreSetType.Story))
|
| | | {
|
| | | return;
|
| | | }
|
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | public class GMNotifyManager : GameSystemManager<GMNotifyManager> |
| | | { |
| | | public override void Init() |
| | | { |
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | gmNotifies.Clear(); |
| | | serverInited = false; |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | serverInited = true; |
| | | } |
| | | |
| | | private List<GMNotifyMessgae> gmNotifies = new List<GMNotifyMessgae>(); |
| | | |
| | | private ArrayList infoArray = new ArrayList(); |
| | | |
| | | private bool serverInited = false; |
| | | |
| | | private void SecondEvent() |
| | | { |
| | | if (!serverInited) |
| | | { |
| | | return; |
| | | } |
| | | for (int i = 0; i < gmNotifies.Count; i++) |
| | | { |
| | | var _notify = gmNotifies[i]; |
| | | if (!CheckNotify(_notify)) |
| | | { |
| | | gmNotifies.RemoveAt(i); |
| | | _notify = null; |
| | | i--; |
| | | continue; |
| | | } |
| | | if (CheckSend()) |
| | | { |
| | | if ((TimeUtility.ServerNow - _notify.nextNotifyTime).TotalSeconds >= 0) |
| | | { |
| | | var _totalMinutes = (int)(TimeUtility.ServerNow - _notify.start).TotalMinutes; |
| | | var _detalMinutes = (_totalMinutes / _notify.interval + 1) * _notify.interval; |
| | | _notify.nextNotifyTime = _notify.start.AddTicks(_detalMinutes * TimeSpan.TicksPerMinute); |
| | | Notify(_notify); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void Notify(HA001_tagBroadCastInfo package) |
| | | { |
| | | if (package.IsDelOthers == 1) |
| | | { |
| | | gmNotifies.Clear(); |
| | | } |
| | | gmNotifies.Add(new GMNotifyMessgae() |
| | | { |
| | | start = TimeUtility.GetTime(package.StartTime), |
| | | end = TimeUtility.GetTime(package.EndTime), |
| | | message = UIHelper.ServerStringTrim(package.Msg).Replace(@"\", string.Empty), |
| | | interval = package.Interval, |
| | | nextNotifyTime = TimeUtility.GetTime(package.StartTime), |
| | | }); |
| | | } |
| | | |
| | | private void Notify(GMNotifyMessgae _notify) |
| | | { |
| | | ServerTipDetails.ShowMarquee(_notify.message, null, 10); |
| | | ChatManager.Instance.AddSysData(_notify.message, infoArray, ChatChannel.World, false); |
| | | } |
| | | |
| | | private bool CheckNotify(GMNotifyMessgae _notify) |
| | | { |
| | | if ((TimeUtility.ServerNow - _notify.end).TotalSeconds > 0) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private bool CheckSend() |
| | | { |
| | | if (StageManager.Instance.currentStage == StageName.Login) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public class GMNotifyMessgae |
| | | { |
| | | public DateTime start; |
| | | public DateTime end; |
| | | public DateTime nextNotifyTime; |
| | | public int interval;//分钟 |
| | | public string message = string.Empty; |
| | | } |
| | | } |
| | | |
| | | |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Message/GMNotify.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: f42b6a1b0c4602c47a26401533a82716 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | private void Awake() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent; |
| | | StageManager.Instance.AfterLoadingGameScene += OnStageLoadFinish; |
| | | // StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish; |
| | | Co_Instance().Forget(); |
| | | } |
| | |
| | | { |
| | | base.OnDestroy(); |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent; |
| | | StageManager.Instance.AfterLoadingGameScene -= OnStageLoadFinish; |
| | | // StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish; |
| | | } |
| | | |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | //命格方案 |
| | | public class MinggeCaseCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Text caseNameText; |
| | | [SerializeField] Transform selectObj; |
| | | [SerializeField] Transform unSelectObj; |
| | | |
| | | public void Display(int index) |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| File was renamed from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: d82ac7d0e4493ee4fb4fe720c72564fb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | public class MinggeEquipCell : MonoBehaviour |
| | | { |
| | | [SerializeField] UIEffectPlayer loopEffect; |
| | | [SerializeField] Text posNameText; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image iconImage; |
| | | [SerializeField] Image skillImage; //只有带意象技能才显示 |
| | | [SerializeField] UIEffectPlayer activeEffect; |
| | | [SerializeField] Button button; |
| | | |
| | | [Header("命格装备位")] |
| | | public int equipIndex; |
| | | |
| | | public void Display() |
| | | { |
| | | var packIndex = equipIndex - 1; //对应卦玉背包索引 = (套编号-1)*12+装备位-1 |
| | | var item = PackManager.Instance.GetItemByIndex(PackType.Mingge, packIndex); |
| | | if (item == null) |
| | | { |
| | | loopEffect?.Stop(); |
| | | posNameText.text = Language.Get($"MinggeGird{packIndex}"); |
| | | iconImage.SetActive(false); |
| | | button.RemoveAllListeners(); |
| | | return; |
| | | } |
| | | posNameText.text = ""; |
| | | iconImage.SetActive(true); |
| | | int itemID = item.config.ID; |
| | | iconImage.SetItemSprite(itemID); |
| | | if (packIndex <= 4 && skillImage != null) |
| | | { |
| | | skillImage.SetActive(true); |
| | | skillImage.SetSprite($"MinggeSkill_{itemID}"); |
| | | loopEffect.Play(); |
| | | } |
| | | else |
| | | { |
| | | skillImage.SetActive(false); |
| | | } |
| | | |
| | | lvText.text = EquipModel.Instance.GetEquipLV(item).ToString(); |
| | | |
| | | button.AddListener(() => |
| | | { |
| | | ItemTipUtility.Show(itemID); |
| | | }); |
| | | } |
| | | |
| | | public void PlayEffect() |
| | | { |
| | | activeEffect.Play(); |
| | | } |
| | | |
| | | } |
| | | |
copy from Main/System/Team/TeamType.cs.meta
copy to Main/System/Mingge/MinggeEquipCell.cs.meta
| File was copied from Main/System/Team/TeamType.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 097080eb83a42b54bbc2b10bc100993b |
| | | guid: df66a8f8775cbdb4bbbc68542b32bbc9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | |
| | | public class MinggeManager : GameSystemManager<MinggeManager> |
| | | { |
| | | public int tyItemID; //推演物品ID |
| | | public int qlItemID; //祈灵物品ID |
| | | public int[] minggeItemTypeList; //可携带意象的卦玉类型列表 |
| | | public int[] minggeSkillTypeIDList; //意向效果技能TypeID列表 |
| | | |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize; |
| | | ParseConfig(); |
| | | } |
| | | |
| | | public override void Release() |
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize; |
| | | } |
| | | |
| | | |
| | | void ParseConfig() |
| | | { |
| | | var config = FuncConfigConfig.Get("MinggeCfg"); |
| | | tyItemID = int.Parse(config.Numerical2); |
| | | qlItemID = int.Parse(config.Numerical3); |
| | | |
| | | config = FuncConfigConfig.Get("MinggeTY"); |
| | | minggeItemTypeList = JsonMapper.ToObject<int[]>(config.Numerical4); |
| | | minggeSkillTypeIDList = JsonMapper.ToObject<int[]>(config.Numerical5); |
| | | |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitialize() |
| | | { |
| | | } |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | public class MinggeWin : UIBase |
| | | { |
| | | |
| | | [SerializeField] Button seeAttrBtn; |
| | | [SerializeField] MinggeEquipCell[] equipCells; |
| | | [SerializeField] MinggeCaseCell[] caseCells; |
| | | [SerializeField] Text rankLevelText; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | |
| | | |
| | | |
| | | // 向服务端请求其他玩家数据 |
| | | public void ViewPlayerDetail(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story) |
| | | public void ViewPlayerDetail(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story) |
| | | { |
| | | if (_playerId == PlayerDatas.Instance.baseData.PlayerID) |
| | | { |
| | |
| | | viewPlayerLineupType = -1; |
| | | } |
| | | #region 获取PlusData中的数据 |
| | | public Dictionary<int, RolePlusData.HeroData> GetHeroDataDict(int playerID, int lineupType) |
| | | |
| | | public int GetFuncPresetID(int playerID, int battleType, int funcType) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | if (viewPlayerData?.rolePlusData?.LineupDic?.TryGetValue(lineupType, out var lineupData) != true) |
| | | if (viewPlayerData?.rolePlusData?.BatPresetDic?.TryGetValue(battleType, out var data) != true) |
| | | { |
| | | return 1; |
| | | } |
| | | return data.ContainsKey(funcType) ? data[funcType] : 1; |
| | | } |
| | | |
| | | public Dictionary<int, RolePlusData.HeroData> GetHeroDataDict(int playerID, int presetID) |
| | | { |
| | | ViewPlayerData viewPlayerData = GetViewPlayerData(playerID); |
| | | if (viewPlayerData?.rolePlusData?.LineupDic?.TryGetValue(presetID, out var lineupData) != true) |
| | | { |
| | | return null; |
| | | } |
| | | return lineupData?.HeroDic; |
| | | } |
| | | |
| | | public List<RolePlusData.HeroData> GetHeroDataSortList(int playerID, int lineupType) |
| | | public List<RolePlusData.HeroData> GetHeroDataSortList(int playerID, int presetID) |
| | | { |
| | | var heroDataDict = GetHeroDataDict(playerID, lineupType); |
| | | var heroDataDict = GetHeroDataDict(playerID, presetID); |
| | | if (heroDataDict == null) |
| | | { |
| | | return null; |
| | |
| | | return res; |
| | | } |
| | | |
| | | public bool TryGetFightPointByTeamType(int playerID, int teamType, out long fightPower) |
| | | public bool TryGetFightPointByTeamType(int playerID, int presetID, out long fightPower) |
| | | { |
| | | fightPower = 0; |
| | | var lineupDic = GetViewPlayerData(playerID)?.rolePlusData?.LineupDic; |
| | | if (lineupDic != null && lineupDic.TryGetValue(teamType, out var lineupData)) |
| | | if (lineupDic != null && lineupDic.TryGetValue(presetID, out var lineupData)) |
| | | { |
| | | fightPower = lineupData.FightPower; |
| | | return true; |
| | |
| | | |
| | | // 阵容字典 <阵容ID, 阵容数据> |
| | | public Dictionary<int, LineupData> LineupDic = new Dictionary<int, LineupData>(); |
| | | public Dictionary<int, Dictionary<int, int>> BatPresetDic = new Dictionary<int, Dictionary<int, int>>(); |
| | | |
| | | // 红颜数据 |
| | | public BeautyData beautyData; |
| | |
| | | |
| | | EquipDic.Clear(); |
| | | LineupDic.Clear(); |
| | | BatPresetDic.Clear(); |
| | | beautyData = null; // 必须置空,防止显示上一个玩家的数据 |
| | | horseData = null; // 必须置空 |
| | | // 1. 转为 JsonData 对象 |
| | |
| | | } |
| | | } |
| | | } |
| | | //BatPreset - {"战斗预设类型":{"预设类型":使用的方案ID, ...}, ...} |
| | | if (jd.Keys.Contains("BatPreset")) |
| | | { |
| | | JsonData batPresetJson = jd["BatPreset"]; |
| | | BatPresetDic = new Dictionary<int, Dictionary<int, int>>(); |
| | | foreach (string outerKey in batPresetJson.Keys) |
| | | { |
| | | if (int.TryParse(outerKey, out int outerKeyInt)) |
| | | { |
| | | JsonData innerJson = batPresetJson[outerKey]; |
| | | var innerDict = new Dictionary<int, int>(); |
| | | foreach (string innerKey in innerJson.Keys) |
| | | { |
| | | if (int.TryParse(innerKey, out int innerKeyInt)) |
| | | { |
| | | innerDict[innerKeyInt] = int.Parse(innerJson[innerKey].ToString()); |
| | | } |
| | | } |
| | | BatPresetDic[outerKeyInt] = innerDict; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | catch (Exception e) |
| | |
| | | OtherPlayerDetailManager.ViewPlayerData viewPlayerData; |
| | | OtherPlayerDetailManager manager { get { return OtherPlayerDetailManager.Instance; } } |
| | | |
| | | int teamType = -1; |
| | | int funcPresetID = -1; //子方案ID |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList += OnRefreshFairyList; |
| | | teamType = functionOrder; |
| | | funcPresetID = OtherPlayerDetailManager.Instance.GetFuncPresetID(manager.viewPlayer, functionOrder, (int)FuncPresetType.Team); |
| | | Display(); |
| | | } |
| | | |
| | |
| | | |
| | | DisplayMM(playerID); |
| | | |
| | | var heroList = manager.GetHeroDataSortList(playerID, teamType); |
| | | var heroList = manager.GetHeroDataSortList(playerID, funcPresetID); |
| | | if (heroList.IsNullOrEmpty()) |
| | | { |
| | | heroList = manager.GetHeroDataSortList(playerID, (int)TeamType.Story); |
| | | heroList = manager.GetHeroDataSortList(playerID, FuncPresetManager.FuncDefaultPresetID); |
| | | } |
| | | DisplayCard(heroList); |
| | | |
| | | long fightPonit; |
| | | if (!manager.TryGetFightPointByTeamType(playerID, teamType, out fightPonit)) |
| | | if (!manager.TryGetFightPointByTeamType(playerID, funcPresetID, out fightPonit)) |
| | | { |
| | | if (!manager.TryGetFightPointByTeamType(playerID, (int)TeamType.Story, out fightPonit)) |
| | | if (!manager.TryGetFightPointByTeamType(playerID, FuncPresetManager.FuncDefaultPresetID, out fightPonit)) |
| | | { |
| | | fightPonit = 0; |
| | | } |
| | |
| | | //自己的公会 |
| | | if (PlayerDatas.Instance.fairyData.HasFairy && PlayerDatas.Instance.fairyData.fairy.FamilyID == viewPlayerData.FamilyID) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GuildTip01"); |
| | | return; |
| | | } |
| | | GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString()); |
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData, (int)TeamType.Story);
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public static class AvatarHelper
|
| | | {
|
| | | public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)TeamType.Story)
|
| | | public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | return;
|
| | |
| | | |
| | | |
| | | // 服务器下发的阵型和阵容,只能通过网络协议赋值,外部只读 |
| | | public TeamType teamType |
| | | public int teamType |
| | | { |
| | | get; |
| | | private set; |
| | | } |
| | | |
| | | private int ShapeType; |
| | | public int ServerShapeType { get; private set; } |
| | | |
| | | |
| | | public TeamHero[] tempHeroes { get; private set; } = new TeamHero[TeamConst.MaxTeamHeroCount]; |
| | | |
| | | public TeamHero[] serverHeroes { get; private set; } = new TeamHero[TeamConst.MaxTeamHeroCount]; |
| | | |
| | | public TeamBase(TeamType _teamType) |
| | | public TeamBase(int _teamType) |
| | | { |
| | | teamType = _teamType; |
| | | teamIndex = 0; |
| | |
| | | } |
| | | teamIndex = lineUp.Num; |
| | | playerId = lineUp.OwnerID; |
| | | ShapeType = lineUp.ShapeType; |
| | | ServerShapeType = lineUp.ShapeType; |
| | | |
| | | for (int i = 0; i < lineUp.ObjCnt; i++) |
| | | { |
| | |
| | | |
| | | CB412_tagCSHeroPresetSave savePack = new CB412_tagCSHeroPresetSave(); |
| | | savePack.PresetID = (byte)teamType; |
| | | savePack.ShapeType = (byte)ShapeType; |
| | | savePack.PosCnt = (byte)GetTeamHeroCount(); |
| | | savePack.HeroPosList = new CB412_tagCSHeroPresetSave.tagCSHeroPresetPos[savePack.PosCnt]; |
| | | |
| | |
| | | //非主线阵容客户端自己做战力变化,主线阵容服务端战力变更会同步推送 |
| | | } |
| | | |
| | | public void OnChangeShapeType(int newShapeType) |
| | | { |
| | | ShapeType = newShapeType; |
| | | } |
| | | |
| | | public void OnServerChangeShapeType(int newShapeType) |
| | | { |
| | | ServerShapeType = newShapeType; |
| | | ShapeType = newShapeType; |
| | | } |
| | | |
| | | |
| | | |
| | | public void RefreshServerData(int shapeType, int positionIndex, HeroInfo heroInfo) |
| | | public void RefreshServerData(int positionIndex, HeroInfo heroInfo) |
| | | { |
| | | TeamHero teamHero = heroInfo == null ? null : new TeamHero(heroInfo, positionIndex, this); |
| | | SetServerTeamHero(positionIndex, teamHero); |
| | | OnServerChangeShapeType(shapeType); |
| | | } |
| | | |
| | | public void CreateDefault(List<HeroInfo> heroInfos) |
| | | { |
| | | teamIndex = 0; |
| | | playerId = PlayerDatas.Instance.baseData.PlayerID; |
| | | OnServerChangeShapeType(0); |
| | | |
| | | for (int i = 0; i < heroInfos.Count; i++) |
| | | { |
| | |
| | | |
| | | public class TeamManager : GameSystemManager<TeamManager> |
| | | { |
| | | protected Dictionary<TeamType, TeamBase> teamDict = new Dictionary<TeamType, TeamBase>(); |
| | | protected Dictionary<int, TeamBase> teamDict = new Dictionary<int, TeamBase>(); |
| | | |
| | | public Action<TeamType> OnTeamChange = null; |
| | | public Action<int> OnTeamChange = null; |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | public void OnHeroChangeEvent(HB124_tagSCHeroPresetInfo vNetData) |
| | | { |
| | | var heroPack = PackManager.Instance.GetSinglePack(PackType.Hero); |
| | | HashSet<TeamType> teamTypeSet = new HashSet<TeamType>(); |
| | | HashSet<int> teamTypeSet = new HashSet<int>(); |
| | | for (int i = 0; i < vNetData.PresetCnt; i++) |
| | | { |
| | | TeamType teamType = (TeamType)vNetData.PresetList[i].PresetID; |
| | | int teamType = vNetData.PresetList[i].PresetID; |
| | | teamTypeSet.Add(teamType); |
| | | var team = GetTeam(teamType); |
| | | for (int j = 0; j < vNetData.PresetList[i].HeroCnt; j++) |
| | |
| | | hero = HeroManager.Instance.GetHero(item.guid); |
| | | |
| | | } |
| | | team.RefreshServerData(vNetData.PresetList[i].ShapeType, j, hero); |
| | | team.RefreshServerData(j, hero); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public bool HasTeam(TeamType teamType) |
| | | public bool HasTeam(int teamType) |
| | | { |
| | | return teamDict.ContainsKey(teamType); |
| | | } |
| | | |
| | | public TeamBase GetTeam(TeamType teamType) |
| | | //通过阵容方案ID获取阵容 |
| | | public TeamBase GetTeam(int teamType) |
| | | { |
| | | TeamBase team = null; |
| | | |
| | |
| | | |
| | | return team; |
| | | } |
| | | |
| | | //通过战斗类型获取阵容 |
| | | public TeamBase GetTeam(BattlePreSetType battlePassType) |
| | | { |
| | | int presetID = GetTeamID((int)battlePassType); |
| | | TeamBase team = null; |
| | | |
| | | if (!teamDict.TryGetValue(presetID, out team)) |
| | | { |
| | | team = new TeamBase(presetID); |
| | | // team.CreateDefault(HeroManager.Instance.GetPowerfulHeroList()); |
| | | teamDict.Add(presetID, team); |
| | | } |
| | | |
| | | return team; |
| | | } |
| | | |
| | | // 获取主阵容方案ID |
| | | public int GetMainTeamID() |
| | | { |
| | | return FuncPresetManager.Instance.GetFuncPresetID((int)BattlePreSetType.Story, (int)FuncPresetType.Team); |
| | | } |
| | | |
| | | public int GetTeamID(int battleType) |
| | | { |
| | | return FuncPresetManager.Instance.GetFuncPresetID(battleType, (int)FuncPresetType.Team); |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | // if (!UIManager.Instance.IsOpened<MarqueeWin>()) |
| | | // { |
| | | // UIManager.Instance.OpenWindow<MarqueeWin>(); |
| | | // } |
| | | if (!UIManager.Instance.IsOpened<MarqueeWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<MarqueeWin>(); |
| | | } |
| | | } |
| | | |
| | | public static void OnStageLoadFinish() |
| | | { |
| | | // if (StageLoad.Instance.currentStage is LoginStage) |
| | | // { |
| | | // m_Marquees.Clear(); |
| | | // return; |
| | | // } |
| | | // Co_StageLoadFinish().Forget(); |
| | | if (StageManager.Instance.currentStage == StageName.Login) |
| | | { |
| | | m_Marquees.Clear(); |
| | | return; |
| | | } |
| | | Co_StageLoadFinish().Forget(); |
| | | } |
| | | |
| | | private static async UniTask Co_StageLoadFinish() |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | static bool CheckOpenMarquee() |
| | | { |
| | | return true; |
| | | // TODO YYL |
| | | // return (StageLoad.Instance.currentStage is DungeonStage) && !StageLoad.Instance.isLoading; |
| | | return StageManager.Instance.currentStage == StageName.Game; |
| | | } |
| | | |
| | | public static SystemHintData RequireMarquee() |
| | |
| | | try |
| | | { |
| | | OnPreOpen(); |
| | | if (layout != null) |
| | | { |
| | | UIUtility.ForceRefreshLayout(layout).Forget(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | try |
| | | { |
| | | NextFrameAfterOpen(); |
| | | if (layout != null) |
| | | { |
| | | UIUtility.ForceRefreshLayout(layout).Forget(); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCLineupConfig npcLineupConfig, out NPCConfig npcConfig) |
| | | public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCConfig npcConfig) |
| | | { |
| | | npcConfig = null; |
| | | npcLineupConfig = null; |
| | | if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out var config)) |
| | | return false; |
| | | int[] lineupIDList = config.LineupIDList; |
| | | if (lineupIDList.IsNullOrEmpty()) |
| | | int npcID = config.NPCID; |
| | | if (!NPCConfig.HasKey(npcID)) |
| | | return false; |
| | | int lineupID = lineupIDList[0]; |
| | | if (!NPCLineupConfig.HasKey(lineupID)) |
| | | return false; |
| | | npcLineupConfig = NPCLineupConfig.Get(lineupID); |
| | | int bossId = npcLineupConfig.BossID; |
| | | if (!NPCConfig.HasKey(bossId)) |
| | | return false; |
| | | npcConfig = NPCConfig.Get(bossId); |
| | | npcConfig = NPCConfig.Get(npcID); |
| | | return true; |
| | | } |
| | | |
| | |
| | | }); |
| | | btnFormation.SetListener(() => |
| | | { |
| | | HeroUIManager.Instance.selectTeamType = TeamType.Story; |
| | | HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetMainTeamID(); |
| | | UIManager.Instance.OpenWindow<HeroPosWin>(); |
| | | }); |
| | | btnSelectOneClick.SetListener(() => |
| | |
| | | int showLayerNum; |
| | | int showLevelNum; |
| | | FBDJGLevelConfig config; |
| | | NPCLineupConfig npcLineupConfig; |
| | | NPCConfig npcConfig; |
| | | private void Display() |
| | | { |
| | |
| | | return; |
| | | if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(showLayerNum, showLevelNum, out config)) |
| | | return; |
| | | if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcLineupConfig, out npcConfig)) |
| | | if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcConfig)) |
| | | return; |
| | | |
| | | txtCurrentLevel.text = Language.Get("WarlordPavilion22", showLayerNum, showLevelNum); |
| | | txtBossName.text = npcConfig.NPCName; |
| | | uiHeroController.Create(npcConfig.SkinID, modelSize); |
| | | DisplaySkillWordsList(npcLineupConfig); |
| | | DisplaySkillWordsList(config.SkillIDExList); |
| | | DisplayItemCell(firstAwards, config.PassAwardList); |
| | | manager.DisplayItemCell(challengeAwards, config.AwardList); |
| | | DisplayButtons(); |
| | |
| | | } |
| | | } |
| | | |
| | | public void DisplaySkillWordsList(NPCLineupConfig lineUPConfig) |
| | | public void DisplaySkillWordsList(int[] skillIDExList) |
| | | { |
| | | if (skillWords.IsNullOrEmpty()) |
| | | return; |
| | | for (int i = 0; i < skillWords.Count; i++) |
| | | { |
| | | if (i < lineUPConfig.SkillIDExList.Length) |
| | | if (i < skillIDExList.Length) |
| | | { |
| | | skillWords[i].SetActive(true); |
| | | int skillID = lineUPConfig.SkillIDExList[i]; |
| | | int skillID = skillIDExList[i]; |
| | | skillWords[i].Init(skillID, () => |
| | | { |
| | | SmallTipWin.showText = Language.Get("SmallTipFomat", SkillConfig.Get(skillID)?.SkillName, SkillConfig.Get(skillID)?.Description); |
| | |
| | | DogzEquip = 33, //神兽装备背包(神兽穿戴) |
| | | |
| | | Hero = 35, // 武将背包 |
| | | Mingge = 36, // 命格装备背包 |
| | | MinggeDrop = 37, //命格掉落背包 |
| | | |
| | | //后续IL开发添加预设 |
| | | default1, //34 垃圾回收 |
| | | default2, |
| | | default3, |
| | | default4, |
| | | default5, |
| | | default6, |
| | | default7, |
| | | default8, |
| | | default9, |
| | | default10, |
| | | |
| | | GatherSoul = 254,//聚魂 |
| | | RunePack = 255,//符印背包 |
| | |
| | | LineupRecommend = 50, //阵容推荐 |
| | | DailySpecials = 51, //每日特惠 |
| | | Mail = 52, //邮箱 |
| | | Mingge = 54, //命格 |
| | | WarlordPavilion = 55, //定军阁 |
| | | } |
| | | |