Merge remote-tracking branch 'origin/master' into h5version
# Conflicts:
# Main/System/Battle/SkillEffect/SkillEffectFactory.cs
# Main/System/Guild/GuildManager.cs
27 文件已复制
5个文件已删除
106个文件已修改
1 文件已重命名
29个文件已添加
| | |
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PresetUnlockConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(RandomNameConfig),
|
| | | typeof(SignInConfig),
|
| | | typeof(SkillSkinConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(TianziConfig),
|
| | | typeof(TimingGiftConfig),
|
| | | typeof(TimingGiftTypeConfig),
|
| | | typeof(TitleConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TravelEventConfig),
|
| | |
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PresetUnlockConfig 字典
|
| | | ClearConfigDictionary<PresetUnlockConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| | | ClearConfigDictionary<PriorBundleConfig>();
|
| | | // 清空 RandomNameConfig 字典
|
| | | ClearConfigDictionary<RandomNameConfig>();
|
| | | // 清空 SignInConfig 字典
|
| | | ClearConfigDictionary<SignInConfig>();
|
| | | // 清空 SkillSkinConfig 字典
|
| | | ClearConfigDictionary<SkillSkinConfig>();
|
| | | // 清空 StoreConfig 字典
|
| | | ClearConfigDictionary<StoreConfig>();
|
| | | // 清空 SuccessConfig 字典
|
| | |
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 TianziConfig 字典
|
| | | ClearConfigDictionary<TianziConfig>();
|
| | | // 清空 TimingGiftConfig 字典
|
| | | ClearConfigDictionary<TimingGiftConfig>();
|
| | | // 清空 TimingGiftTypeConfig 字典
|
| | | ClearConfigDictionary<TimingGiftTypeConfig>();
|
| | | // 清空 TitleConfig 字典
|
| | | ClearConfigDictionary<TitleConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: Tuesday, January 20, 2026 |
| | | // [ Date ]: Friday, February 6, 2026 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public int[][] PassAwardList; |
| | | public int[][] AwardList; |
| | | public int[] LineupIDList; |
| | | public int NPCLV; |
| | | public long FightPower; |
| | | public int NPCID; |
| | | public int[] SkillIDExList; |
| | | |
| | | public override int LoadKey(string _key) |
| | |
| | | } |
| | | } |
| | | |
| | | long.TryParse(tables[6],out FightPower); |
| | | int.TryParse(tables[6],out NPCLV); |
| | | |
| | | int.TryParse(tables[7],out NPCID); |
| | | long.TryParse(tables[7],out FightPower); |
| | | |
| | | if (tables[8].Contains("[")) |
| | | { |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年12月12日
|
| | | // [ Date ]: 2026年2月7日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | | public int[] BuffStateLimit;
|
| | | public int BuffState;
|
| | | public int FightPower;
|
| | | public string SkillMotionName;
|
| | | public string IconName;
|
| | | public string BuffIconName;
|
| | | public string SkillTipsName;
|
| | | public int EffectType;
|
| | | public int StartupFrames;
|
| | | public int[] ActiveFrames;
|
| | | public int RecoveryFrames;
|
| | | public int LoopCount;
|
| | | public int CastPosition;
|
| | | public int CastIndexNum;
|
| | | public float CastDistance;
|
| | | public int[][] DamageDivide;
|
| | | public int BulletEffectId;
|
| | | public int BulletPath;
|
| | | public float BulletFlySpeed;
|
| | | public int Scattering;
|
| | | public int ExplosionEffectId;
|
| | | public int ExplosionEffect2;
|
| | | public int ExplosionEffect3;
|
| | | public int ExplosionEffect4;
|
| | | public int EffectId;
|
| | | public int EffectId2;
|
| | | public int SkinllSFX1;
|
| | | public int SkinllSFX2;
|
| | | public int MStartEffectId;
|
| | | public int BuffEffect;
|
| | | public int TriggerEffect;
|
| | | public int ClientTriggerTiming;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | |
| | |
|
| | | int.TryParse(tables[18],out FightPower);
|
| | |
|
| | | SkillMotionName = tables[19];
|
| | | IconName = tables[19];
|
| | |
|
| | | IconName = tables[20];
|
| | | BuffIconName = tables[20];
|
| | |
|
| | | BuffIconName = tables[21];
|
| | | SkillTipsName = tables[21];
|
| | |
|
| | | SkillTipsName = tables[22];
|
| | | int.TryParse(tables[22],out Scattering); |
| | |
|
| | | int.TryParse(tables[23],out EffectType); |
| | |
|
| | | int.TryParse(tables[24],out StartupFrames); |
| | |
|
| | | if (tables[25].Contains("[")) |
| | | { |
| | | ActiveFrames = JsonMapper.ToObject<int[]>(tables[25]); |
| | | } |
| | | else |
| | | { |
| | | string[] ActiveFramesStringArray = tables[25].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ActiveFrames = new int[ActiveFramesStringArray.Length]; |
| | | for (int i=0;i<ActiveFramesStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ActiveFramesStringArray[i],out ActiveFrames[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[26],out RecoveryFrames); |
| | |
|
| | | int.TryParse(tables[27],out LoopCount); |
| | |
|
| | | int.TryParse(tables[28],out CastPosition); |
| | |
|
| | | int.TryParse(tables[29],out CastIndexNum); |
| | |
|
| | | float.TryParse(tables[30],out CastDistance); |
| | |
|
| | | DamageDivide = JsonMapper.ToObject<int[][]>(tables[31].Replace("(", "[").Replace(")", "]")); |
| | |
|
| | | int.TryParse(tables[32],out BulletEffectId); |
| | |
|
| | | int.TryParse(tables[33],out BulletPath); |
| | |
|
| | | float.TryParse(tables[34],out BulletFlySpeed); |
| | |
|
| | | int.TryParse(tables[35],out Scattering); |
| | |
|
| | | int.TryParse(tables[36],out ExplosionEffectId); |
| | |
|
| | | int.TryParse(tables[37],out ExplosionEffect2); |
| | |
|
| | | int.TryParse(tables[38],out ExplosionEffect3); |
| | |
|
| | | int.TryParse(tables[39],out ExplosionEffect4); |
| | |
|
| | | int.TryParse(tables[40],out EffectId); |
| | |
|
| | | int.TryParse(tables[41],out EffectId2); |
| | |
|
| | | int.TryParse(tables[42],out SkinllSFX1); |
| | |
|
| | | int.TryParse(tables[43],out SkinllSFX2); |
| | |
|
| | | int.TryParse(tables[44],out MStartEffectId); |
| | |
|
| | | int.TryParse(tables[45],out BuffEffect); |
| | |
|
| | | int.TryParse(tables[46],out TriggerEffect); |
| | |
|
| | | int.TryParse(tables[47],out ClientTriggerTiming); |
| | | int.TryParse(tables[23],out ClientTriggerTiming); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年2月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class SkillSkinConfig : ConfigBase<string, SkillSkinConfig> |
| | | { |
| | | static SkillSkinConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public string SkillSkinID; |
| | | public string SkillMotionName; |
| | | public int EffectType; |
| | | public int CastPosition; |
| | | public int CastIndexNum; |
| | | public float CastDistance; |
| | | public int StartupFrames; |
| | | public int[] ActiveFrames; |
| | | public int RecoveryFrames; |
| | | public int LoopCount; |
| | | public int[][] DamageDivide; |
| | | public int BulletEffectId; |
| | | public int BulletPath; |
| | | public float BulletFlySpeed; |
| | | public int ExplosionEffectId; |
| | | public int ExplosionEffect2; |
| | | public int ExplosionEffect3; |
| | | public int ExplosionEffect4; |
| | | public int EffectId; |
| | | public int EffectId2; |
| | | public int SkinllSFX1; |
| | | public int SkinllSFX2; |
| | | public int MStartEffectId; |
| | | public int BuffEffect; |
| | | public int TriggerEffect; |
| | | |
| | | public override string LoadKey(string _key) |
| | | { |
| | | string key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | SkillSkinID = tables[0]; |
| | | |
| | | SkillMotionName = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out EffectType); |
| | | |
| | | int.TryParse(tables[3],out CastPosition); |
| | | |
| | | int.TryParse(tables[4],out CastIndexNum); |
| | | |
| | | float.TryParse(tables[5],out CastDistance); |
| | | |
| | | int.TryParse(tables[6],out StartupFrames); |
| | | |
| | | if (tables[7].Contains("[")) |
| | | { |
| | | ActiveFrames = JsonMapper.ToObject<int[]>(tables[7]); |
| | | } |
| | | else |
| | | { |
| | | string[] ActiveFramesStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ActiveFrames = new int[ActiveFramesStringArray.Length]; |
| | | for (int i=0;i<ActiveFramesStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ActiveFramesStringArray[i],out ActiveFrames[i]); |
| | | } |
| | | } |
| | | |
| | | int.TryParse(tables[8],out RecoveryFrames); |
| | | |
| | | int.TryParse(tables[9],out LoopCount); |
| | | |
| | | DamageDivide = JsonMapper.ToObject<int[][]>(tables[10].Replace("(", "[").Replace(")", "]")); |
| | | |
| | | int.TryParse(tables[11],out BulletEffectId); |
| | | |
| | | int.TryParse(tables[12],out BulletPath); |
| | | |
| | | float.TryParse(tables[13],out BulletFlySpeed); |
| | | |
| | | int.TryParse(tables[14],out ExplosionEffectId); |
| | | |
| | | int.TryParse(tables[15],out ExplosionEffect2); |
| | | |
| | | int.TryParse(tables[16],out ExplosionEffect3); |
| | | |
| | | int.TryParse(tables[17],out ExplosionEffect4); |
| | | |
| | | int.TryParse(tables[18],out EffectId); |
| | | |
| | | int.TryParse(tables[19],out EffectId2); |
| | | |
| | | int.TryParse(tables[20],out SkinllSFX1); |
| | | |
| | | int.TryParse(tables[21],out SkinllSFX2); |
| | | |
| | | int.TryParse(tables[22],out MStartEffectId); |
| | | |
| | | int.TryParse(tables[23],out BuffEffect); |
| | | |
| | | int.TryParse(tables[24],out TriggerEffect); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Config/Configs/SkillSkinConfig.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 16994c332e272e048a0ce72b27c91aaf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年2月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class TimingGiftConfig : ConfigBase<int, TimingGiftConfig> |
| | | { |
| | | static TimingGiftConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int GiftID; |
| | | public string GiftName; |
| | | public int GiftType; |
| | | public int[] CTGIDs; |
| | | public int[] TopColor; |
| | | public int[] BottomColor; |
| | | public int[] OutlineColor; |
| | | |
| | | 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 GiftID); |
| | | |
| | | GiftName = tables[1]; |
| | | |
| | | int.TryParse(tables[2],out GiftType); |
| | | |
| | | if (tables[3].Contains("[")) |
| | | { |
| | | CTGIDs = JsonMapper.ToObject<int[]>(tables[3]); |
| | | } |
| | | else |
| | | { |
| | | string[] CTGIDsStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | CTGIDs = new int[CTGIDsStringArray.Length]; |
| | | for (int i=0;i<CTGIDsStringArray.Length;i++) |
| | | { |
| | | int.TryParse(CTGIDsStringArray[i],out CTGIDs[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[4].Contains("[")) |
| | | { |
| | | TopColor = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] TopColorStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | TopColor = new int[TopColorStringArray.Length]; |
| | | for (int i=0;i<TopColorStringArray.Length;i++) |
| | | { |
| | | int.TryParse(TopColorStringArray[i],out TopColor[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[5].Contains("[")) |
| | | { |
| | | BottomColor = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] BottomColorStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | BottomColor = new int[BottomColorStringArray.Length]; |
| | | for (int i=0;i<BottomColorStringArray.Length;i++) |
| | | { |
| | | int.TryParse(BottomColorStringArray[i],out BottomColor[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[6].Contains("[")) |
| | | { |
| | | OutlineColor = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] OutlineColorStringArray = tables[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | OutlineColor = new int[OutlineColorStringArray.Length]; |
| | | for (int i=0;i<OutlineColorStringArray.Length;i++) |
| | | { |
| | | int.TryParse(OutlineColorStringArray[i],out OutlineColor[i]); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Config/Configs/TimingGiftConfig.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 0d0f2d099d904734e8c8cdb9ffa748ad |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年2月5日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class TimingGiftTypeConfig : ConfigBase<int, TimingGiftTypeConfig> |
| | | { |
| | | static TimingGiftTypeConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int GiftType; |
| | | public int Duration; |
| | | public int TriggleChangeRate; |
| | | |
| | | 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 GiftType); |
| | | |
| | | int.TryParse(tables[1],out Duration); |
| | | |
| | | int.TryParse(tables[2],out TriggleChangeRate); |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Config/Configs/TimingGiftTypeConfig.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 79fc1592c88c38746980c51334e7ec72 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | return waveLineupLists.Count(list => list.Length > 0); |
| | | } |
| | | |
| | | static List<int> allLevels = new List<int>(); |
| | | // 获取目标关卡的索引 |
| | | public static int GetToTargetLevelIndex(int targetLevel) |
| | | { |
| | | var levels = GetKeys(); |
| | | levels.Sort(); |
| | | return levels.IndexOf(targetLevel); |
| | | if (allLevels.IsNullOrEmpty()) |
| | | { |
| | | allLevels = GetKeys(); |
| | | allLevels.Sort(); |
| | | } |
| | | return allLevels.IndexOf(targetLevel); |
| | | |
| | | } |
| | | |
| | |
| | | public static readonly int[] DebuffSkillType = new int[] { 4, 6, 14 }; |
| | | |
| | | public SkillType skillType; |
| | | public SkillCastMode castMode; |
| | | |
| | | public SkillEffectType effectType; |
| | | protected SkillSkinConfig originSkinConfig; |
| | | |
| | | //技能类型:技能等级:技能 |
| | | static Dictionary<int, Dictionary<int, SkillConfig>> skillDics = new Dictionary<int, Dictionary<int, SkillConfig>>(); |
| | |
| | | base.OnConfigParseCompleted(); |
| | | |
| | | skillType = (SkillType)SkillType; |
| | | castMode = (SkillCastMode)CastPosition; |
| | | effectType = (SkillEffectType)EffectType; |
| | | |
| | | if (DamageDivide == null || DamageDivide.Length == 0) |
| | | { |
| | | DamageDivide = new int[1][]; |
| | | DamageDivide[0] = new int[] { 10000 }; |
| | | } |
| | | |
| | | // #if UNITY_EDITOR |
| | | // if (Launch.Instance.isOpenBattleDebug) |
| | | // { |
| | | // if (castMode == SkillCastMode.None) |
| | | // { |
| | | // castMode = SkillCastMode.Target; |
| | | // } |
| | | // } |
| | | // #endif |
| | | |
| | | Dictionary<int, SkillConfig> tempDic = null; |
| | | if (!skillDics.TryGetValue((int)skillType, out tempDic)) |
| | |
| | | skillDics.Add((int)skillType, tempDic); |
| | | } |
| | | tempDic[SkillLV] = this; |
| | | } |
| | | |
| | | public SkillSkinConfig GetSkillSkinConfig(int skinID) |
| | | { |
| | | string key = skinID.ToString() + SkillID.ToString(); |
| | | |
| | | SkillSkinConfig skillSkinConfig = SkillSkinConfig.Get(key); |
| | | |
| | | if (null == skillSkinConfig) |
| | | { |
| | | return GetOriginSkinConfig(); |
| | | } |
| | | else |
| | | { |
| | | return skillSkinConfig; |
| | | } |
| | | } |
| | | |
| | | public SkillSkinConfig GetOriginSkinConfig() |
| | | { |
| | | if (originSkinConfig == null) |
| | | { |
| | | originSkinConfig = SkillSkinConfig.Get(SkillID.ToString()); |
| | | } |
| | | if (null == originSkinConfig) |
| | | { |
| | | Debug.LogError("找不到技能皮肤配置 " + SkillID); |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return originSkinConfig; |
| | | } |
| | | } |
| | | |
| | | public bool IsGainBuff() |
| | |
| | | { |
| | | return Array.Exists(DebuffSkillType, type => type == (int)skillType); |
| | | } |
| | | |
| | | public MotionName GetMotionName() |
| | | { |
| | | return Enum.Parse<MotionName>(SkillMotionName); |
| | | } |
| | | |
| | | public static SkillConfig GetSkillConfig(int skillType, int skillLv) |
| | | { |
| | |
| | | return config; |
| | | } |
| | | |
| | | public List<int> GetDamageDivide(int _hitIndex) |
| | | { |
| | | List<int> damageDivide = new List<int>(); |
| | | if (_hitIndex == 0 && DamageDivide.Length <= 0) |
| | | { |
| | | damageDivide.Add(10000); |
| | | } |
| | | else |
| | | { |
| | | if (DamageDivide.Length <= _hitIndex) |
| | | { |
| | | Debug.LogError("技能伤害分布配置错误 skillId: " + SkillID + " hitIndex: " + _hitIndex); |
| | | damageDivide.Add(10000); |
| | | } |
| | | else |
| | | { |
| | | damageDivide = DamageDivide[_hitIndex].ToList(); |
| | | } |
| | | } |
| | | return damageDivide; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2026年2月7日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | using System.Linq; |
| | | |
| | | |
| | | public partial class SkillSkinConfig : ConfigBase<string, SkillSkinConfig> |
| | | { |
| | | public SkillCastMode castMode; |
| | | |
| | | public SkillEffectType effectType; |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | base.OnConfigParseCompleted(); |
| | | |
| | | castMode = (SkillCastMode)CastPosition; |
| | | effectType = (SkillEffectType)EffectType; |
| | | |
| | | |
| | | if (DamageDivide == null || DamageDivide.Length == 0) |
| | | { |
| | | DamageDivide = new int[1][]; |
| | | DamageDivide[0] = new int[] { 10000 }; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public MotionName GetMotionName() |
| | | { |
| | | return Enum.Parse<MotionName>(SkillMotionName); |
| | | } |
| | | |
| | | public List<int> GetDamageDivide(int _hitIndex) |
| | | { |
| | | List<int> damageDivide = new List<int>(); |
| | | if (_hitIndex == 0 && DamageDivide.Length <= 0) |
| | | { |
| | | damageDivide.Add(10000); |
| | | } |
| | | else |
| | | { |
| | | if (DamageDivide.Length <= _hitIndex) |
| | | { |
| | | Debug.LogError("技能伤害分布配置错误 SkillSkinID: " + SkillSkinID + " hitIndex: " + _hitIndex); |
| | | damageDivide.Add(10000); |
| | | } |
| | | else |
| | | { |
| | | damageDivide = DamageDivide[_hitIndex].ToList(); |
| | | } |
| | | } |
| | | return damageDivide; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Config/PartialConfigs/SkillSkinConfig.Partial.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 2e0292b891c625c45985eefa582a2463 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class TimingGiftConfig : ConfigBase<int, TimingGiftConfig> |
| | | { |
| | | |
| | | public static Dictionary<int, List<int>> typeToGiftIdList = null; |
| | | |
| | | private static void LoadTypeToGiftIdList() |
| | | { |
| | | if (typeToGiftIdList != null) |
| | | return; |
| | | typeToGiftIdList = new Dictionary<int, List<int>>(); |
| | | |
| | | foreach (var config in GetValues()) |
| | | { |
| | | if (!typeToGiftIdList.ContainsKey(config.GiftType)) |
| | | { |
| | | typeToGiftIdList[config.GiftType] = new List<int>(); |
| | | } |
| | | if (!typeToGiftIdList[config.GiftType].Contains(config.GiftID)) |
| | | { |
| | | typeToGiftIdList[config.GiftType].Add(config.GiftID); |
| | | } |
| | | } |
| | | |
| | | foreach (var type in typeToGiftIdList.Keys) |
| | | { |
| | | typeToGiftIdList[type].Sort(); |
| | | } |
| | | } |
| | | |
| | | public static Dictionary<int, List<int>> GetTypeToGiftIdDict() |
| | | { |
| | | LoadTypeToGiftIdList(); |
| | | return typeToGiftIdList; |
| | | } |
| | | |
| | | public static bool TryGetTypeToGiftIdList(int type, out List<int> giftIdList) |
| | | { |
| | | giftIdList = null; |
| | | LoadTypeToGiftIdList(); |
| | | return !typeToGiftIdList.IsNullOrEmpty() && typeToGiftIdList.TryGetValue(type, out giftIdList) && giftIdList != null; |
| | | } |
| | | |
| | | public static bool TryGetTimingGiftConfig(int id, out TimingGiftConfig config) |
| | | { |
| | | config = null; |
| | | if (!HasKey(id)) |
| | | return false; |
| | | config = Get(id); |
| | | return true; |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Config/PartialConfigs/TimingGiftConfig.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 1dc8c2bc48ca2254aaa2efe08e81f5f8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | break; |
| | | case PlayerDataType.ExAttr1: |
| | | baseData.ExAttr1 = Math.Max((int)value, 10100); //新号初始处理 |
| | | Debug.LogFormat("---- 收到服务端ExAttr1: {0}", baseData.ExAttr1); |
| | | break; |
| | | case PlayerDataType.ExAttr2: |
| | | baseData.ExAttr2 = Math.Max((int)value, 10101); //新号初始处理 |
| | | Debug.LogFormat("---- 收到服务端ExAttr2: {0}", baseData.ExAttr2); |
| | | break; |
| | | case PlayerDataType.ExAttr3://称号 |
| | | baseData.TitleID = (int)value; |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 31 前端自定义保存设置内容 #tagCSSettingData |
| | | |
| | | public class CA131_tagCSSettingData : GameNetPackBasic { |
| | | public byte KeyNum; // 自定义key编号,后端使用数字key存储,前端自行进行转换定义,限制100个 |
| | | public byte DataLen; |
| | | public string SetData; //自定义保存的内容 |
| | | |
| | | public CA131_tagCSSettingData () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA131; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (KeyNum, NetDataType.BYTE); |
| | | WriteBytes (DataLen, NetDataType.BYTE); |
| | | WriteBytes (SetData, NetDataType.Chars, DataLen); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA131_tagCSSettingData.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: f237c6f43939ca64894d301a44913fa7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | |
| | | public class CA212_tagCMViewPlayerInfo : GameNetPackBasic { |
| | | public uint PlayerID; |
| | | public byte EquipClassLV; //大于0为查看指定境界阶装备信息, 0为查看默认信息 |
| | | public uint ServerID; //玩家服务器ID,发0默认本服玩家 |
| | | |
| | | public CA212_tagCMViewPlayerInfo () { |
| | | combineCmd = (ushort)0x03FE; |
| | |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (PlayerID, NetDataType.DWORD); |
| | | WriteBytes (EquipClassLV, NetDataType.BYTE); |
| | | WriteBytes (ServerID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A6 19 查看目标公会 #tagCSViewTagFamily |
| | | |
| | | public class CA619_tagCSViewTagFamily : GameNetPackBasic { |
| | | public uint FamilyID; |
| | | public uint DataServerID; //数据所在服务器ID |
| | | |
| | | public CA619_tagCSViewTagFamily () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xA619; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (FamilyID, NetDataType.DWORD); |
| | | WriteBytes (DataServerID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA6_Family/CA619_tagCSViewTagFamily.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 2bf49c967e6a89b4c93efd500fbd7583 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | if (hB427_TagSCUseSkill != null) |
| | | { |
| | | SkillConfig scCfg = SkillConfig.Get((int)hB427_TagSCUseSkill.SkillID); |
| | | if (!string.IsNullOrEmpty(scCfg.SkillMotionName)) |
| | | SkillSkinConfig skillSkinConfig = scCfg.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | needWaiting = true; |
| | | return needWaiting; |
| | |
| | | if (pack is HB427_tagSCUseSkill skillPack && skillPack != hB427_TagSCUseSkill) |
| | | { |
| | | SkillConfig ssc = SkillConfig.Get((int)skillPack.SkillID); |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | SkillSkinConfig skillSkinConfig = ssc.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | needWaiting = true; |
| | | break; |
| | |
| | | |
| | | public class DTC0418_tagObjInfoRefresh : DtcBasic { |
| | | //类型 |
| | | static Dictionary<int, ulong> lastPackUIDDict = new Dictionary<int, ulong>() |
| | | static Dictionary<int, GameNetPackBasic> lastPackDict = new Dictionary<int, GameNetPackBasic>() |
| | | { |
| | | #if UNITY_EDITOR |
| | | {(int)PlayerDataType.ExAttr1, 0}, |
| | | {(int)PlayerDataType.ExAttr2, 0}, |
| | | #endif |
| | | {(int)PlayerDataType.default26, 0}, |
| | | {(int)PlayerDataType.ExAttr1, null}, |
| | | {(int)PlayerDataType.ExAttr2, null}, |
| | | {(int)PlayerDataType.default26, null}, |
| | | }; |
| | | public override void Done(GameNetPackBasic vNetPack) |
| | | { |
| | |
| | | case 1: |
| | | if (vNetData.packUID > DTC0102_tagCDBPlayer.loginPackUID) |
| | | { |
| | | if (lastPackUIDDict.ContainsKey(vNetData.RefreshType)) |
| | | if (lastPackDict.ContainsKey(vNetData.RefreshType)) |
| | | { |
| | | if (vNetData.packUID < lastPackUIDDict[vNetData.RefreshType]) |
| | | var lastPack = lastPackDict[vNetData.RefreshType]; |
| | | if (lastPack != null && vNetData.packUID < lastPackDict[vNetData.RefreshType].packUID) |
| | | { |
| | | Debug.LogWarning($"封包顺序问题 0418 封包太旧被过滤 {vNetData.packUID} > {lastPackUIDDict[vNetData.RefreshType]}"); |
| | | return; |
| | | vNetData = lastPack as H0418_tagObjInfoRefresh; |
| | | if (null == vNetData) |
| | | { |
| | | return; |
| | | } |
| | | Debug.LogError("重置0418数据为上一个包,刷新数据 packUID:" + vNetData.packUID); |
| | | } |
| | | lastPackUIDDict[vNetData.RefreshType] = vNetData.packUID; |
| | | lastPackDict[vNetData.RefreshType] = vNetData; |
| | | } |
| | | //防范断线重连时,战斗中的旧包影响数据 |
| | | Update0418(vNetData); |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 31 前端自定义保存的设置内容信息 #tagSCSettingDataInfo |
| | | |
| | | public class DTCA131_tagSCSettingDataInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HA131_tagSCSettingDataInfo vNetData = vNetPack as HA131_tagSCSettingDataInfo; |
| | | SettingDataManager.Instance.UpdateSettingData(vNetData); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA131_tagSCSettingDataInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 0eed7575356cfc54f9665f3f7653c520 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 05 公会跨服互通信息 #tagSCFamilyCrossInfo
|
| | |
|
| | | public class DTCA505_tagSCFamilyCrossInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA505_tagSCFamilyCrossInfo vNetData = vNetPack as HA505_tagSCFamilyCrossInfo;
|
| | | GuildManager.Instance.OnRefreshCrossServerInfo(vNetData);
|
| | | }
|
| | | }
|
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA505_tagSCFamilyCrossInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: b6a841aca303f3d4bb7fa214596b9fb4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 19 查看目标公会信息 #tagSCTagFamilyInfo |
| | | |
| | | public class DTCA519_tagSCTagFamilyInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HA519_tagSCTagFamilyInfo vNetData = vNetPack as HA519_tagSCTagFamilyInfo; |
| | | GuildManager.Instance.UpdateViewFamilyInfo(vNetData); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA519_tagSCTagFamilyInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: e31d54337b63cd94cb7faac99d8f1eaf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 24 公会成员删除 #tagSCFamilyMemDel
|
| | |
|
| | | public class DTCA524_tagSCFamilyMemDel : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA524_tagSCFamilyMemDel vNetData = vNetPack as HA524_tagSCFamilyMemDel;
|
| | | PlayerDatas.Instance.fairyData.DeleteMember(vNetData);
|
| | | }
|
| | | }
|
| File was renamed from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: de4a083265d8ebf438ab2e65d0925d9e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using LitJson; |
| | | using Codice.Client.BaseCommands; |
| | | |
| | | // B4 20 回合制战斗状态 #tagMCTurnFightState |
| | | |
| | |
| | | if (battleField != null) |
| | | { |
| | | JsonData extendData = JsonMapper.ToObject(vNetData.Msg); |
| | | battleField.OnTurnFightState(vNetData.TurnNum, vNetData.State, (int)vNetData.FuncLineID, extendData); |
| | | battleField.OnTurnFightState(vNetData.TurnNum, vNetData.State, (int)vNetData.FuncLineID, extendData); |
| | | if (vNetData.MapID == 1 && (vNetData.FuncLineID > PlayerDatas.Instance.baseData.ExAttr2)) |
| | | { |
| | | Debug.LogErrorFormat("---- 收到服务端 DTCB420_tagMCTurnFightState 的 FuncLineID :{0} 大于客户端记录 ExAttr2 {1}", vNetData.FuncLineID, PlayerDatas.Instance.baseData.ExAttr2); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | Register(typeof(HA512_tagMCFamilyZhenbaogeInfo), typeof(DTCA512_tagMCFamilyZhenbaogeInfo)); |
| | | Register(typeof(HA513_tagMCFamilyActionInfo), typeof(DTCA513_tagMCFamilyActionInfo)); |
| | | Register(typeof(HA520_tagMCRoleFamilyInfo), typeof(DTCA520_tagMCRoleFamilyInfo)); |
| | | Register(typeof(HA521_tagMCFamilyChange), typeof(DTCA521_tagMCFamilyChange)); |
| | | Register(typeof(HA524_tagSCFamilyMemDel), typeof(DTCA524_tagSCFamilyMemDel)); |
| | | Register(typeof(HA505_tagSCFamilyCrossInfo), typeof(DTCA505_tagSCFamilyCrossInfo)); |
| | | Register(typeof(HA522_tagMCFamilyReqJoinInfo), typeof(DTCA522_tagMCFamilyReqJoinInfo)); |
| | | Register(typeof(HA523_tagMCFamilyViewList), typeof(DTCA523_tagMCFamilyViewList)); |
| | | Register(typeof(HA009_tagSCGameRecInfo), typeof(DTCA009_tagSCGameRecInfo)); |
| | |
| | | Register(typeof(HB162_tagSCFuncPresetSwitchInfo), typeof(DTCB162_tagSCFuncPresetSwitchInfo)); |
| | | Register(typeof(HB163_tagSCBatPresetSwitchInfo), typeof(DTCB163_tagSCBatPresetSwitchInfo)); |
| | | Register(typeof(HA001_tagBroadCastInfo), typeof(DTCA001_tagBroadCastInfo)); |
| | | Register(typeof(HA519_tagSCTagFamilyInfo), typeof(DTCA519_tagSCTagFamilyInfo)); |
| | | Register(typeof(HA131_tagSCSettingDataInfo), typeof(DTCA131_tagSCSettingDataInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A1 31 前端自定义保存的设置内容信息 #tagSCSettingDataInfo |
| | | |
| | | public class HA131_tagSCSettingDataInfo : GameNetPackBasic { |
| | | public ushort DataCnt; |
| | | public tagSCSettingData[] SettingDataList; |
| | | |
| | | public HA131_tagSCSettingDataInfo () { |
| | | _cmd = (ushort)0xA131; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out DataCnt, vBytes, NetDataType.WORD); |
| | | SettingDataList = new tagSCSettingData[DataCnt]; |
| | | for (int i = 0; i < DataCnt; i ++) { |
| | | SettingDataList[i] = new tagSCSettingData(); |
| | | TransBytes (out SettingDataList[i].KeyNum, vBytes, NetDataType.BYTE); |
| | | TransBytes (out SettingDataList[i].DataLen, vBytes, NetDataType.BYTE); |
| | | TransBytes (out SettingDataList[i].SetData, vBytes, NetDataType.Chars, SettingDataList[i].DataLen); |
| | | } |
| | | } |
| | | |
| | | public class tagSCSettingData { |
| | | public byte KeyNum; // 自定义key编号,后端使用数字key存储,前端自行进行转换定义,限制100个 |
| | | public byte DataLen; |
| | | public string SetData; //自定义保存的内容 |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA1_Sys/HA131_tagSCSettingDataInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 19c12567a8e6d994b823f21885a07bc2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 05 公会跨服互通信息 #tagSCFamilyCrossInfo
|
| | |
|
| | | public class HA505_tagSCFamilyCrossInfo : GameNetPackBasic {
|
| | | public byte ZoneID; // 所属分区
|
| | | public ushort ServerCnt;
|
| | | public uint[] ServerIDList; // 互通服务器ID列表
|
| | |
|
| | | public HA505_tagSCFamilyCrossInfo () {
|
| | | _cmd = (ushort)0xA505;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ZoneID, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ServerCnt, vBytes, NetDataType.WORD);
|
| | | TransBytes (out ServerIDList, vBytes, NetDataType.DWORD, ServerCnt);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA5_Family/HA505_tagSCFamilyCrossInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 2975d104ad2db9747a57b40c35de08e2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 19 查看目标公会信息 #tagSCTagFamilyInfo |
| | | |
| | | public class HA519_tagSCTagFamilyInfo : GameNetPackBasic { |
| | | public uint FamilyID; //家族ID |
| | | public byte FamilyNameLen; |
| | | public string FamilyName; //size = FamilyNameLen |
| | | public uint LeaderID; //族长ID |
| | | public byte LeaderNameLen; |
| | | public string LeaderName; //size = LeaderNameLen |
| | | public uint LeaderServerID; //会长区服ID |
| | | public byte FamilyLV; //家族等级 |
| | | public uint ServerID; //区服ID |
| | | public uint EmblemID; //徽章ID |
| | | public string EmblemWord; //徽章文字 |
| | | public uint FightPower; //总战力,求余亿部分 |
| | | public uint FightPowerEx; //总战力,整除亿部分 |
| | | public ushort BroadcastLen; //公告 |
| | | public string Broadcast; //size = BroadcastLen |
| | | public byte MemberCount; //成员人数 |
| | | public uint DataServerID; //数据所在服务器ID |
| | | |
| | | public HA519_tagSCTagFamilyInfo () { |
| | | _cmd = (ushort)0xA519; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out FamilyID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FamilyNameLen, vBytes, NetDataType.BYTE); |
| | | TransBytes (out FamilyName, vBytes, NetDataType.Chars, FamilyNameLen); |
| | | TransBytes (out LeaderID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out LeaderNameLen, vBytes, NetDataType.BYTE); |
| | | TransBytes (out LeaderName, vBytes, NetDataType.Chars, LeaderNameLen); |
| | | TransBytes (out LeaderServerID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FamilyLV, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ServerID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out EmblemID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out EmblemWord, vBytes, NetDataType.Chars, 3); |
| | | TransBytes (out FightPower, vBytes, NetDataType.DWORD); |
| | | TransBytes (out FightPowerEx, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BroadcastLen, vBytes, NetDataType.WORD); |
| | | TransBytes (out Broadcast, vBytes, NetDataType.Chars, BroadcastLen); |
| | | TransBytes (out MemberCount, vBytes, NetDataType.BYTE); |
| | | TransBytes (out DataServerID, vBytes, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA5_Family/HA519_tagSCTagFamilyInfo.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 487779c3213b8a94e861c50bc592c1dd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | public uint LeaderID; //族长玩家ID
|
| | | public byte MemberCount; //人数
|
| | | public tagMCRoleFamilyMember[] MemberList; //size = MemberCount
|
| | | public uint Extra1; //附加字段1
|
| | |
|
| | | public HA520_tagMCRoleFamilyInfo () {
|
| | | _cmd = (ushort)0xA520;
|
| | |
| | | TransBytes (out MemberList[i].DonateCntDay, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MemberList[i].OffTime, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | TransBytes (out Extra1, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | public class tagMCRoleFamilyMember {
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A5 23 搜索家族返回列表 #tagMCFamilyViewList
|
| | |
|
| | | public class HA523_tagMCFamilyViewList : GameNetPackBasic {
|
| | |
| | | public byte TotalPage; //一共有多少页
|
| | | public byte FamilyCount;
|
| | | public tagMCFamilyView[] FamilyList; //本页家族信息列表
|
| | | public uint Rank; //玩家公会所在名次,0-没有公会或没有在榜上;>0-对应排名
|
| | |
|
| | | public HA523_tagMCFamilyViewList () {
|
| | | _cmd = (ushort)0xA523;
|
| | |
| | | TransBytes (out FamilyList[i].LeaderID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyList[i].LeaderNameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].LeaderName, vBytes, NetDataType.Chars, FamilyList[i].LeaderNameLen);
|
| | | TransBytes (out FamilyList[i].LeaderServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyList[i].FamilyLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].JoinReview, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out FamilyList[i].JoinLVMin, vBytes, NetDataType.WORD);
|
| | |
| | | TransBytes (out FamilyList[i].FightPowerEx, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyList[i].MemberCount, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | TransBytes (out Rank, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | public class tagMCFamilyView {
|
| | |
| | | public uint LeaderID; //族长ID
|
| | | public byte LeaderNameLen;
|
| | | public string LeaderName; //size = LeaderNameLen
|
| | | public uint LeaderServerID; //族长服务器ID
|
| | | public byte FamilyLV; //家族等级
|
| | | public byte JoinReview; //成员加入是否需要审核,默认0自动加入
|
| | | public ushort JoinLVMin; //限制最低可加入的玩家等级
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A5 24 公会成员删除 #tagSCFamilyMemDel
|
| | |
|
| | | public class HA524_tagSCFamilyMemDel : GameNetPackBasic {
|
| | | public byte Type; // 0-踢出;1-主动退出
|
| | | public uint PlayerID;
|
| | | public byte NameLen;
|
| | | public string Name;
|
| | |
|
| | | public HA524_tagSCFamilyMemDel () {
|
| | | _cmd = (ushort)0xA524;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Type, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Name, vBytes, NetDataType.Chars, NameLen);
|
| | | }
|
| | |
|
| | | }
|
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA5_Family/HA524_tagSCFamilyMemDel.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 824719d9672072944a5ff55b15e93e52 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A7 05 查询玩家详细信息结果#tagSCQueryPlayerCacheResult
|
| | |
|
| | | public class HA705_tagSCQueryPlayerCacheResult : GameNetPackBasic {
|
| | |
| | | public string FamilyName;
|
| | | public uint FamilyEmblemID; //仙盟徽章ID
|
| | | public string FamilyEmblemWord; //徽章文字
|
| | | public uint FamilyDataServerID; //公会数据所在服务器ID,A619查看公会用
|
| | | public uint PlusDataSize;
|
| | | public string PlusData; //扩展记录
|
| | |
|
| | |
| | | TransBytes (out FamilyName, vBytes, NetDataType.Chars, 33);
|
| | | TransBytes (out FamilyEmblemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FamilyEmblemWord, vBytes, NetDataType.Chars, 3);
|
| | | TransBytes (out FamilyDataServerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusDataSize, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out PlusData, vBytes, NetDataType.Chars, PlusDataSize);
|
| | | }
|
| | |
|
| | | }
|
| | | } |
| | |
| | | // B0 40 游历信息 #tagSCTravelInfo
|
| | |
|
| | | public class HB040_tagSCTravelInfo : GameNetPackBasic {
|
| | | public byte Energy; //剩余体力
|
| | | public uint Energy; //剩余体力
|
| | | public uint EnergyTime; //上次恢复体力时间戳
|
| | | public uint TravelCnt; //累计游历次数
|
| | | public byte SceneryType; //景观类型
|
| | |
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Energy, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out Energy, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out EnergyTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TravelCnt, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out SceneryType, vBytes, NetDataType.BYTE);
|
| | |
| | | managers.Add(MinggeManager.Instance);
|
| | | managers.Add(FuncPresetManager.Instance);
|
| | | managers.Add(GMNotifyManager.Instance);
|
| | | managers.Add(TimingGiftManager.Instance);
|
| | | managers.Add(SettingDataManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | |
| | | } |
| | | } |
| | | |
| | | protected void RefreshBuffCells(List<BattleBuffCell> cells, List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (datas == null) |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | cells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (battleField.battleSwitch.BuffIcon) |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | var cell = cells[i]; |
| | | if (i < datas.Count) |
| | | { |
| | | cell.SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | cell.Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | cell.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | cells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | protected virtual void BindMingge() |
| | | { |
| | | if (minggeObj == null) |
| | |
| | | return GetTeamNode(battleCamp, index); |
| | | } |
| | | |
| | | public RectTransform GetTeamNode(BattleCamp battleCamp, SkillConfig skillConfig) |
| | | public RectTransform GetTeamNode(BattleCamp battleCamp, SkillSkinConfig skillSkinConfig) |
| | | { |
| | | int index = skillConfig.CastIndexNum - 1; // 技能配置的index是从1开始的,所以要减1 |
| | | int index = skillSkinConfig.CastIndexNum - 1; // 技能配置的index是从1开始的,所以要减1 |
| | | return GetTeamNode(battleCamp, index); |
| | | } |
| | | |
| | |
| | | if (isCast) |
| | | return; |
| | | |
| | | if (skillBase.caster.CanCastSkillAnimation(skillBase.skillConfig)) |
| | | if (skillBase.caster.CanCastSkillAnimation(skillBase.skillSkinConfig)) |
| | | { |
| | | // Debug.LogError("cast skill id is " + skillBase.skillConfig.SkillID); |
| | | |
| | |
| | | } |
| | | fsBattleWin.SetBattleField(this); |
| | | |
| | | if (UIManager.Instance.IsOpened<WarlordPavilionWin>()) |
| | | if (UIManager.Instance.IsOpened<TowerBaseWin>()) |
| | | { |
| | | UIManager.Instance.CloseWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.CloseWindow<TowerBaseWin>(); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <summary> |
| | | /// 播放技能动画 |
| | | /// </summary> |
| | | public abstract Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete); |
| | | public abstract Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isCounter, Action onComplete); |
| | | |
| | | /// <summary> |
| | | /// 检查是否可以开始死亡 |
| | |
| | | /// <summary> |
| | | /// 检查是否可以释放技能 |
| | | /// </summary> |
| | | public abstract bool CanCastSkillAnimation(SkillConfig skillConfig); |
| | | public abstract bool CanCastSkillAnimation(SkillSkinConfig skillSkinConfig); |
| | | |
| | | /// <summary> |
| | | /// 获取骨骼动画组件(用于特效挂载等) |
| | |
| | | } |
| | | |
| | | // ============ 应用施法者的血量和护盾变化 ============ |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | ApplyHurtToCaster(battleHurtParam, isLastHit); |
| | | |
| | | // 和Hurt一样,调用PopDamage处理吸血/反伤的显示 |
| | |
| | | Debug.LogError($"BattleObjectFactory: Failed to load SkeletonDataAsset for {skinCfg.SpineRes}"); |
| | | return null; |
| | | } |
| | | |
| | | // Debug.LogError($"{teamHero.SkinID} : {skinCfg.SpineRes}"); |
| | | |
| | | // ============================================== |
| | | |
| | | #pragma warning disable CS0618 |
| | |
| | | } |
| | | } |
| | | |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | { |
| | | return motionBase.PlaySkillAnimation(skillConfig, skillBase, isCounter, onComplete); |
| | | return motionBase.PlaySkillAnimation(skillConfig, skillSkinConfig, skillBase, isCounter, onComplete); |
| | | } |
| | | |
| | | public override bool CanStartDeath() |
| | |
| | | return motionBase.CanStartDeath(); |
| | | } |
| | | |
| | | public override bool CanCastSkillAnimation(SkillConfig skillConfig) |
| | | public override bool CanCastSkillAnimation(SkillSkinConfig skillSkinConfig) |
| | | { |
| | | return motionBase.CanCastSkill(skillConfig); |
| | | return motionBase.CanCastSkill(skillSkinConfig); |
| | | } |
| | | |
| | | public override SkeletonAnimation GetSkeletonAnimation() |
| | |
| | | public override DeathRecordAction Hurt(BattleHurtParam battleHurtParam, SkillRecordAction _parentSkillAction = null) |
| | | { |
| | | DeathRecordAction recordAction = null; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | bool firstHit = battleHurtParam.hitIndex == 0; |
| | | |
| | | // 添加调试日志 |
| | |
| | | } |
| | | |
| | | // ============ 应用施法者的血量和护盾变化 ============ |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | ApplyHurtToCaster(battleHurtParam, isLastHit); |
| | | |
| | | // 和Hurt一样,调用PopDamage处理吸血/反伤的显示 |
| | |
| | | // 命格没有幻影 |
| | | } |
| | | |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | public override Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isCounter, Action onComplete) |
| | | { |
| | | // 命格没有技能动画,立即触发所有帧事件 |
| | | int loopCount = skillConfig.LoopCount + 1; //默认会有一次 |
| | | int frameCount = skillConfig.ActiveFrames.Length; |
| | | int loopCount = skillSkinConfig.LoopCount + 1; //默认会有一次 |
| | | int frameCount = skillSkinConfig.ActiveFrames.Length; |
| | | |
| | | // 1. 技能开始 |
| | | skillBase.OnSkillStart(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | public override bool CanCastSkillAnimation(SkillConfig skillConfig) |
| | | public override bool CanCastSkillAnimation(SkillSkinConfig skillSkinConfig) |
| | | { |
| | | // 命格总是可以释放技能(从动画角度) |
| | | return true; |
| | |
| | | // 普攻技能 |
| | | if (teamHero.heroConfig.AtkSkillID > 0) |
| | | { |
| | | AddSingleSkillResources(teamHero.heroConfig.AtkSkillID, info, isPersistent, ownerId); |
| | | SkillConfig skillConfig = SkillConfig.Get(teamHero.heroConfig.AtkSkillID); |
| | | if (null != skillConfig) |
| | | { |
| | | SkillSkinConfig skillSkinConfig = skillConfig.GetSkillSkinConfig(teamHero.SkinID); |
| | | if (null != skillSkinConfig) |
| | | { |
| | | AddSingleSkillResources(skillSkinConfig, info, isPersistent, ownerId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 怒气技能 |
| | | if (teamHero.heroConfig.AngerSkillID > 0) |
| | | { |
| | | AddSingleSkillResources(teamHero.heroConfig.AngerSkillID, info, isPersistent, ownerId); |
| | | SkillConfig skillConfig = SkillConfig.Get(teamHero.heroConfig.AngerSkillID); |
| | | if (null != skillConfig) |
| | | { |
| | | SkillSkinConfig skillSkinConfig = skillConfig.GetSkillSkinConfig(teamHero.SkinID); |
| | | if (null != skillSkinConfig) |
| | | { |
| | | AddSingleSkillResources(skillSkinConfig, info, isPersistent, ownerId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加单个技能的资源 |
| | | /// </summary> |
| | | private static void AddSingleSkillResources(int skillId, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | private static void AddSingleSkillResources(SkillSkinConfig skillSkinConfig, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | { |
| | | SkillConfig skillConfig = SkillConfig.Get(skillId); |
| | | if (skillConfig == null) |
| | | return; |
| | | |
| | | AddSkillAudio(skillConfig, info, isPersistent, ownerId); |
| | | AddSkillEffects(skillConfig, info, isPersistent, ownerId); |
| | | AddSkillAudio(skillSkinConfig, info, isPersistent, ownerId); |
| | | AddSkillEffects(skillSkinConfig, info, isPersistent, ownerId); |
| | | } |
| | | |
| | | private static void AddSkillAudio(SkillConfig skillConfig, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | private static void AddSkillAudio(SkillSkinConfig skillSkinConfig, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | { |
| | | if (skillConfig.SkinllSFX1 > 0) |
| | | if (skillSkinConfig.SkinllSFX1 > 0) |
| | | { |
| | | AddAudioResource(skillConfig.SkinllSFX1, info, isPersistent, ownerId); |
| | | AddAudioResource(skillSkinConfig.SkinllSFX1, info, isPersistent, ownerId); |
| | | } |
| | | |
| | | if (skillConfig.SkinllSFX2 > 0) |
| | | if (skillSkinConfig.SkinllSFX2 > 0) |
| | | { |
| | | AddAudioResource(skillConfig.SkinllSFX2, info, isPersistent, ownerId); |
| | | AddAudioResource(skillSkinConfig.SkinllSFX2, info, isPersistent, ownerId); |
| | | } |
| | | } |
| | | |
| | | private static void AddSkillEffects(SkillConfig skillConfig, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | private static void AddSkillEffects(SkillSkinConfig skillSkinConfig, TeamResourceInfo info, bool isPersistent, string ownerId) |
| | | { |
| | | List<int> effectIds = new List<int>(); |
| | | |
| | | if (skillConfig.BulletEffectId > 0) effectIds.Add(skillConfig.BulletEffectId); |
| | | if (skillConfig.ExplosionEffectId > 0) effectIds.Add(skillConfig.ExplosionEffectId); |
| | | if (skillConfig.ExplosionEffect2 > 0) effectIds.Add(skillConfig.ExplosionEffect2); |
| | | if (skillConfig.ExplosionEffect3 > 0) effectIds.Add(skillConfig.ExplosionEffect3); |
| | | if (skillConfig.ExplosionEffect4 > 0) effectIds.Add(skillConfig.ExplosionEffect4); |
| | | if (skillConfig.EffectId > 0) effectIds.Add(skillConfig.EffectId); |
| | | if (skillConfig.EffectId2 > 0) effectIds.Add(skillConfig.EffectId2); |
| | | if (skillConfig.MStartEffectId > 0) effectIds.Add(skillConfig.MStartEffectId); |
| | | if (skillConfig.BuffEffect > 0) effectIds.Add(skillConfig.BuffEffect); |
| | | if (skillConfig.TriggerEffect > 0) effectIds.Add(skillConfig.TriggerEffect); |
| | | if (skillSkinConfig.BulletEffectId > 0) effectIds.Add(skillSkinConfig.BulletEffectId); |
| | | if (skillSkinConfig.ExplosionEffectId > 0) effectIds.Add(skillSkinConfig.ExplosionEffectId); |
| | | if (skillSkinConfig.ExplosionEffect2 > 0) effectIds.Add(skillSkinConfig.ExplosionEffect2); |
| | | if (skillSkinConfig.ExplosionEffect3 > 0) effectIds.Add(skillSkinConfig.ExplosionEffect3); |
| | | if (skillSkinConfig.ExplosionEffect4 > 0) effectIds.Add(skillSkinConfig.ExplosionEffect4); |
| | | if (skillSkinConfig.EffectId > 0) effectIds.Add(skillSkinConfig.EffectId); |
| | | if (skillSkinConfig.EffectId2 > 0) effectIds.Add(skillSkinConfig.EffectId2); |
| | | if (skillSkinConfig.MStartEffectId > 0) effectIds.Add(skillSkinConfig.MStartEffectId); |
| | | if (skillSkinConfig.BuffEffect > 0) effectIds.Add(skillSkinConfig.BuffEffect); |
| | | if (skillSkinConfig.TriggerEffect > 0) effectIds.Add(skillSkinConfig.TriggerEffect); |
| | | |
| | | foreach (int effectId in effectIds) |
| | | { |
| | |
| | | { |
| | | long suckHp = GetSuckHp(skillBase.tagUseSkillAttack); |
| | | SkillConfig skillConfig = skillBase.skillConfig; |
| | | SkillSkinConfig skillSkinConfig = skillBase.skillSkinConfig; |
| | | long totalDamage = GeneralDefine.GetFactValue(hurt.HurtHP, hurt.HurtHPEx); |
| | | long totalReflectHp = hurt.BounceHP; |
| | | |
| | | // 计算伤害分段 |
| | | long currentHitDamage = 0; |
| | | List<long> damageList = DivideDamageToList(skillConfig.DamageDivide, hitIndex, totalDamage, ref currentHitDamage); |
| | | List<long> damageList = DivideDamageToList(skillSkinConfig.DamageDivide, hitIndex, totalDamage, ref currentHitDamage); |
| | | |
| | | // 计算吸血分段 |
| | | long currentHitSuckHp = 0; |
| | | List<long> suckHpList = bSuckHp ? |
| | | DivideDamageToList(skillConfig.DamageDivide, hitIndex, suckHp, ref currentHitSuckHp) : new List<long>(); |
| | | DivideDamageToList(skillSkinConfig.DamageDivide, hitIndex, suckHp, ref currentHitSuckHp) : new List<long>(); |
| | | |
| | | // 计算反伤分段 |
| | | long currentHitReflectHp = 0; |
| | | List<long> reflectHpList = DivideDamageToList(skillConfig.DamageDivide, hitIndex, totalReflectHp, ref currentHitReflectHp); |
| | | List<long> reflectHpList = DivideDamageToList(skillSkinConfig.DamageDivide, hitIndex, totalReflectHp, ref currentHitReflectHp); |
| | | |
| | | // 创建目标受伤对象 |
| | | BattleHurtObj hurter = CreateHurter(target, damageList, hurt, hitIndex, skillConfig, currentHitDamage); |
| | | BattleHurtObj hurter = CreateHurter(target, damageList, hurt, hitIndex, skillSkinConfig, currentHitDamage); |
| | | |
| | | // 创建施法者对象 |
| | | BattleCastObj caster = CreateCaster(skillBase, suckHpList, reflectHpList, currentHitSuckHp, currentHitReflectHp); |
| | |
| | | battleHurtParam.hitIndex = hitIndex; |
| | | battleHurtParam.deadPack = deadPack; |
| | | battleHurtParam.skillConfig = skillConfig; |
| | | battleHurtParam.skillSkinConfig = skillSkinConfig; |
| | | battleHurtParam.packUID = skillBase.tagUseSkillAttack.packUID; |
| | | return battleHurtParam; |
| | | } |
| | | |
| | | public static BattleHurtObj CreateHurter(BattleObject target, List<long> damageList, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, int hitIndex, SkillConfig skillConfig, long currentHitDamage) |
| | | public static BattleHurtObj CreateHurter(BattleObject target, List<long> damageList, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, int hitIndex, SkillSkinConfig skillSkinConfig, long currentHitDamage) |
| | | { |
| | | BattleHurtObj hurter = new BattleHurtObj(); |
| | | hurter.hurtObj = target; |
| | |
| | | hurter.fromShieldValue = buffMgr != null ? buffMgr.GetShieldValue() : 0; // 命格没有护盾 |
| | | |
| | | // 判断是否是最后一击 |
| | | bool isLastHit = hitIndex >= skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = hitIndex >= skillSkinConfig.DamageDivide.Length - 1; |
| | | |
| | | // 判断是治疗还是伤害 |
| | | bool isHealing = IsHealing(hurt); |
| | |
| | | { |
| | | var skillID = hB427_TagSCUseSkill.SkillID; |
| | | var skillConfig = SkillConfig.Get((int)skillID); |
| | | var skillSkinConfig = skillConfig.GetOriginSkinConfig(); |
| | | |
| | | if (null == skillConfig) |
| | | { |
| | |
| | | |
| | | public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (buffCells == null) |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | if (i < datas.Count) |
| | | { |
| | | buffCells[i].SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | buffCells[i].Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | RefreshBuffCells(buffCells, datas); |
| | | } |
| | | |
| | | bool IsOpenBattleChangeTab() |
| | |
| | | { |
| | | HB428_tagSCBuffRefresh buffData = null; |
| | | |
| | | |
| | | bool isRemove = false; |
| | | |
| | | if (buffDataDict.TryGetValue(tempvNetData.BuffID, out buffData)) |
| | |
| | | return; |
| | | } |
| | | |
| | | BattleObject buffCaster = battleObject.battleField.battleObjMgr.GetBattleObject((int)buffData.OwnerID); |
| | | |
| | | if (null == buffCaster) |
| | | { |
| | | Debug.LogError("找不到buff caster 对象 id is " + buffData.OwnerID + " buff id is " + tempvNetData.BuffID + " pack uid is " + vNetData.packUID); |
| | | } |
| | | |
| | | bool isRemoveEffect = false; |
| | | |
| | | int remainCnt = -1; |
| | | |
| | | if (buffData != null) |
| | | if (buffData != null && buffCaster != null) |
| | | { |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | SkillSkinConfig skillSkinConfig = null; |
| | | if (buffCaster is HeroBattleObject heroBattleObject) |
| | | { |
| | | skillSkinConfig = skillConfig.GetSkillSkinConfig(heroBattleObject.teamHero.SkinID); |
| | | } |
| | | else |
| | | { |
| | | skillSkinConfig = skillConfig.GetOriginSkinConfig(); |
| | | } |
| | | |
| | | if (null == skillConfig || skillConfig.BuffEffect <= 0) |
| | | if (null == skillConfig || skillSkinConfig.BuffEffect <= 0) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | KeyValuePair<BattleEffectPlayer, HashSet<uint>> effectPair; |
| | | |
| | | if (buffEffectDict.TryGetValue(skillConfig.BuffEffect, out effectPair)) |
| | | if (buffEffectDict.TryGetValue(skillSkinConfig.BuffEffect, out effectPair)) |
| | | { |
| | | effectPair.Value.Remove(buffData.BuffID); |
| | | |
| | |
| | | { |
| | | // 没有这个buff了 |
| | | isRemoveEffect = true; |
| | | battleObject.battleField.battleEffectMgr.RemoveEffect(skillConfig.BuffEffect, effectPair.Key); |
| | | buffEffectDict.Remove(skillConfig.BuffEffect); |
| | | battleObject.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BuffEffect, effectPair.Key); |
| | | buffEffectDict.Remove(skillSkinConfig.BuffEffect); |
| | | } |
| | | } |
| | | |
| | |
| | | if (battleObject.IsDead()) |
| | | return; |
| | | |
| | | if (skillConfig.BuffEffect > 0) |
| | | BattleObject buffCaster = battleObject.battleField.battleObjMgr.GetBattleObject((int)buffRefresh.OwnerID); |
| | | |
| | | if (null == buffCaster) |
| | | { |
| | | if (buffEffectDict.TryGetValue(skillConfig.BuffEffect, out var pair)) |
| | | Debug.LogError("找不到buff caster 对象 id is " + buffRefresh.OwnerID + " buff id is " + buffRefresh.BuffID + " pack uid is " + buffRefresh.packUID); |
| | | } |
| | | |
| | | SkillSkinConfig skillSkinConfig = null; |
| | | |
| | | if (buffCaster is HeroBattleObject heroBattleObject) |
| | | { |
| | | skillSkinConfig = skillConfig.GetSkillSkinConfig(heroBattleObject.teamHero.SkinID); |
| | | } |
| | | else |
| | | { |
| | | skillSkinConfig = skillConfig.GetOriginSkinConfig(); |
| | | } |
| | | |
| | | |
| | | if (skillSkinConfig.BuffEffect > 0) |
| | | { |
| | | if (buffEffectDict.TryGetValue(skillSkinConfig.BuffEffect, out var pair)) |
| | | { |
| | | pair.Value.Add(buffRefresh.BuffID); |
| | | } |
| | | else |
| | | { |
| | | BattleEffectPlayer effect = battleObject.battleField.battleEffectMgr |
| | | .PlayEffect(battleObject, skillConfig.BuffEffect, battleObject.GetRectTransform(), battleObject.Camp, battleObject.GetModelScale()); |
| | | .PlayEffect(battleObject, skillSkinConfig.BuffEffect, battleObject.GetRectTransform(), battleObject.Camp, battleObject.GetModelScale()); |
| | | |
| | | effect.BindBone(battleObject, effect.effectConfig.nodeName); |
| | | |
| | | var buffIdSet = new HashSet<uint> { buffRefresh.BuffID }; |
| | | buffEffectDict.Add( |
| | | skillConfig.BuffEffect, |
| | | skillSkinConfig.BuffEffect, |
| | | new KeyValuePair<BattleEffectPlayer, HashSet<uint>>(effect, buffIdSet)); |
| | | } |
| | | } |
| | |
| | | this.battleFieldGuid = battleFieldGuid; |
| | | this.battleHurtParam = battleHurtParam; |
| | | this.isCasterView = _isCasterView; |
| | | this.isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillConfig.DamageDivide.Length - 1; |
| | | this.isLastHit = battleHurtParam.hitIndex >= battleHurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | this.isFirstHit = battleHurtParam.hitIndex == 0; |
| | | |
| | | m_rawAttackType = hurt == null ? 0 : hurt.AttackTypes; |
| | |
| | | public int hitIndex; |
| | | public BattleDeadPack deadPack; |
| | | public SkillConfig skillConfig; |
| | | public SkillSkinConfig skillSkinConfig; |
| | | |
| | | public ulong packUID; |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | public Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillBase skillBase, bool isSubSkill, Action onComplete = null) |
| | | public Spine.TrackEntry PlaySkillAnimation(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, bool isSubSkill, Action onComplete = null) |
| | | { |
| | | if (skillConfig == null) |
| | | { |
| | |
| | | } |
| | | |
| | | // 如果没有动画名称,使用无动画模式 |
| | | if (string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | if (string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | PlaySkillNoAnim(skillConfig, skillBase, onComplete, isSubSkill); |
| | | PlaySkillNoAnim(skillConfig, skillSkinConfig, skillBase, onComplete, isSubSkill); |
| | | return null; |
| | | } |
| | | |
| | | Spine.Animation targetAnim = FindAnim(skillConfig.SkillMotionName); |
| | | Spine.Animation targetAnim = FindAnim(skillSkinConfig.SkillMotionName); |
| | | if (targetAnim == null) |
| | | { |
| | | skillBase.ForceFinished(); |
| | | return null; |
| | | } |
| | | |
| | | return ExecuteSkillAnim(skillConfig, skillBase, onComplete, targetAnim, true, isSubSkill); |
| | | return ExecuteSkillAnim(skillConfig, skillSkinConfig, skillBase, onComplete, targetAnim, true, isSubSkill); |
| | | } |
| | | |
| | | |
| | | private Spine.TrackEntry ExecuteSkillAnim(SkillConfig skillConfig, SkillBase skillBase, Action onComplete, |
| | | private Spine.TrackEntry ExecuteSkillAnim(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, Action onComplete, |
| | | Spine.Animation targetAnim, bool hasAnim, bool isSubSkill) |
| | | { |
| | | |
| | | int loopCount = skillConfig.LoopCount; |
| | | int loopCount = skillSkinConfig.LoopCount; |
| | | // 前摇 |
| | | int startupFrames = skillConfig.StartupFrames; |
| | | int startupFrames = skillSkinConfig.StartupFrames; |
| | | // 中摇 |
| | | int[] activeFrames = skillConfig.ActiveFrames ?? new int[0]; |
| | | int[] activeFrames = skillSkinConfig.ActiveFrames ?? new int[0]; |
| | | int frameCount = activeFrames.Length; |
| | | // 后摇 |
| | | float recoveryFrame = skillConfig.RecoveryFrames; |
| | | float recoveryFrame = skillSkinConfig.RecoveryFrames; |
| | | |
| | | // 如果前中后摇没有配置 那么默认给一个1 2 3的帧数 |
| | | if (startupFrames <= 0 && frameCount == 0 && recoveryFrame <= 0f) |
| | |
| | | { |
| | | // 轨道池耗尽或未初始化,回退到无动画模式 |
| | | Debug.LogWarning($"子技能轨道池已满或未初始化,技能{skillConfig.SkillID}使用无动画模式"); |
| | | PlaySkillNoAnim(skillConfig, skillBase, onComplete, isSubSkill); |
| | | PlaySkillNoAnim(skillConfig, skillSkinConfig, skillBase, onComplete, isSubSkill); |
| | | return null; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (skillBase != null && !skillBase.IsFinished()) |
| | | { |
| | | PlaySkillAnimation(skillConfig, skillBase, isSubSkill, onComplete); |
| | | PlaySkillAnimation(skillConfig, skillSkinConfig, skillBase, isSubSkill, onComplete); |
| | | } |
| | | }); |
| | | return null; |
| | |
| | | } |
| | | |
| | | // 各阶段回调(原有逻辑) |
| | | if (!beginTriggered && currentFrame >= skillConfig.StartupFrames && currentLoop == 0) |
| | | if (!beginTriggered && currentFrame >= skillSkinConfig.StartupFrames && currentLoop == 0) |
| | | { |
| | | beginTriggered = true; |
| | | skillBase.OnStartSkillFrameEnd(); |
| | | } |
| | | |
| | | if (!middleStarted && currentFrame >= skillConfig.StartupFrames && currentLoop <= loopCount) |
| | | if (!middleStarted && currentFrame >= skillSkinConfig.StartupFrames && currentLoop <= loopCount) |
| | | { |
| | | middleStarted = true; |
| | | skillBase.OnMiddleFrameStart(currentLoop); |
| | |
| | | { |
| | | if (hasAnim) |
| | | { |
| | | skillTrack.TrackTime = skillConfig.StartupFrames / BattleConst.skillMotionFps; |
| | | skillTrack.TrackTime = skillSkinConfig.StartupFrames / BattleConst.skillMotionFps; |
| | | } |
| | | else |
| | | { |
| | | // 为下一 loop 重置 startTime,并且更新 pausedAccumulatedAtStart(以保持基线) |
| | | startTime = Time.time - (skillConfig.StartupFrames / BattleConst.skillMotionFps); |
| | | startTime = Time.time - (skillSkinConfig.StartupFrames / BattleConst.skillMotionFps); |
| | | pausedAccumulatedAtStart = pausedAccumulated; |
| | | } |
| | | } |
| | |
| | | return targetAnim; |
| | | } |
| | | |
| | | private void PlaySkillNoAnim(SkillConfig skillConfig, SkillBase skillBase, Action onComplete, bool isSubSkill) => |
| | | ExecuteSkillAnim(skillConfig, skillBase, onComplete, null, false, isSubSkill); |
| | | private void PlaySkillNoAnim(SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, SkillBase skillBase, Action onComplete, bool isSubSkill) => |
| | | ExecuteSkillAnim(skillConfig, skillSkinConfig, skillBase, onComplete, null, false, isSubSkill); |
| | | |
| | | protected virtual void SetupAnimationHandlers() |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | public bool CanCastSkill(SkillConfig skillConfig) |
| | | public bool CanCastSkill(SkillSkinConfig skillSkinConfig) |
| | | { |
| | | return !playingSkillWithAnim || string.IsNullOrEmpty(skillConfig.SkillMotionName); |
| | | return !playingSkillWithAnim || string.IsNullOrEmpty(skillSkinConfig.SkillMotionName); |
| | | } |
| | | |
| | | public bool CanStartDeath() |
| | |
| | | protected SkillEffect skillEffect; |
| | | public HB427_tagSCUseSkill tagUseSkillAttack; |
| | | public SkillConfig skillConfig; |
| | | |
| | | public SkillSkinConfig skillSkinConfig; |
| | | protected bool isFinished = false; |
| | | protected BattleField battleField = null; // 战场 |
| | | protected RectTransform targetNode = null; // 目标节点 |
| | |
| | | tagUseSkillAttack = vNetData; |
| | | battleField = _battleField; |
| | | packList = _packList; |
| | | |
| | | if (_caster is HeroBattleObject heroBattleObject) |
| | | { |
| | | skillSkinConfig = skillConfig.GetSkillSkinConfig(heroBattleObject.teamHero.SkinID); |
| | | |
| | | if (null == skillSkinConfig) |
| | | { |
| | | Debug.LogError("找不到技能皮肤表 " + "skillId: " + skillConfig.SkillID + " skinId: " + heroBattleObject.teamHero.SkinID); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | skillSkinConfig = skillConfig.GetOriginSkinConfig(); |
| | | } |
| | | |
| | | |
| | | // 注册正在释放的技能 |
| | | if (battleField != null && caster != null) |
| | |
| | | // 命格释放技能时 teamHero 为 null,监听器会正确处理(已有 null 检查) |
| | | EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero); |
| | | |
| | | if (skillConfig.SkinllSFX1 != 0) |
| | | if (skillSkinConfig.SkinllSFX1 != 0) |
| | | { |
| | | battleField.soundManager.PlayEffectSound(skillConfig.SkinllSFX1, false); |
| | | battleField.soundManager.PlayEffectSound(skillSkinConfig.SkinllSFX1, false); |
| | | } |
| | | |
| | | if (caster != null) |
| | |
| | | HighLightAllTargets(); |
| | | |
| | | // 根据释放模式执行相应逻辑 |
| | | switch (skillConfig.castMode) |
| | | switch (skillSkinConfig.castMode) |
| | | { |
| | | case SkillCastMode.None: |
| | | case SkillCastMode.Self: |
| | |
| | | DashCast(OnAttackFinish); |
| | | break; |
| | | default: |
| | | Debug.LogError("强制结束技能 暂时不支持其他的方式释放 有需求please联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillConfig.CastPosition); |
| | | Debug.LogError("强制结束技能 暂时不支持其他的方式释放 有需求please联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillSkinConfig.CastPosition); |
| | | ForceFinished(); |
| | | break; |
| | | } |
| | |
| | | // 对敌方释放技能:移动到敌方区域进行攻击 |
| | | protected void CastToEnemy() |
| | | { |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig); |
| | | RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillSkinConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | |
| | | // 对友方释放技能:移动到友方区域进行治疗或增益 |
| | | protected void CastToAllies() |
| | | { |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillConfig); |
| | | RectTransform target = battleField.GetTeamNode(caster.Camp, skillSkinConfig); |
| | | ExecuteMoveAndCastSequence(target, () => |
| | | { |
| | | if (skillConfig.ClientTriggerTiming == 1) |
| | |
| | | private void ExecuteMoveAndCastSequence(RectTransform target, Action onReturnComplete) |
| | | { |
| | | ShadowIllutionCreate(true); |
| | | MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () => |
| | | MoveToTarget(target, new Vector2(skillSkinConfig.CastDistance, 0), () => |
| | | { |
| | | if (skillConfig.CastDistance < 9999 && skillConfig.SkinllSFX2 != 0) |
| | | if (skillSkinConfig.CastDistance < 9999 && skillSkinConfig.SkinllSFX2 != 0) |
| | | { |
| | | battleField.soundManager.PlayEffectSound(skillConfig.SkinllSFX2, false); |
| | | battleField.soundManager.PlayEffectSound(skillSkinConfig.SkinllSFX2, false); |
| | | } |
| | | |
| | | TurnBack(() => |
| | |
| | | // 移动到目标位置:处理角色的移动动画和逻辑 |
| | | protected void MoveToTarget(RectTransform target, Vector2 offset, Action _onComplete = null, float speed = 750f) |
| | | { |
| | | if (skillConfig.CastDistance >= 9999) |
| | | if (skillSkinConfig.CastDistance >= 9999) |
| | | { |
| | | _onComplete?.Invoke(); |
| | | return; |
| | |
| | | // 转身逻辑:根据技能配置处理角色转向 |
| | | protected void TurnBack(Action _onComplete, float forward) |
| | | { |
| | | if (skillConfig.CastDistance < 0) |
| | | if (skillSkinConfig.CastDistance < 0) |
| | | { |
| | | caster.SetFacing(forward); |
| | | } |
| | |
| | | // 执行技能释放动画和逻辑:播放施法动作并提供回调 |
| | | protected TrackEntry CastImpl(Action onComplete = null) |
| | | { |
| | | return caster.PlaySkillAnimation(skillConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | return caster.PlaySkillAnimation(skillConfig, skillSkinConfig, this, tagUseSkillAttack.BattleType == 4, onComplete); |
| | | } |
| | | |
| | | // 技能开始回调:处理死亡、子技能、技能效果初始化 |
| | |
| | | // 再处理 内嵌技能 |
| | | ProcessSubSkill(); |
| | | |
| | | skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, tagUseSkillAttack); |
| | | skillEffect = SkillEffectFactory.CreateSkillEffect(this, caster, skillConfig, skillSkinConfig, tagUseSkillAttack); |
| | | skillEffect.Play(OnHitTargets); |
| | | |
| | | |
| | |
| | | if (pack is HB427_tagSCUseSkill skillPack) |
| | | { |
| | | SkillConfig ssc = SkillConfig.Get((int)skillPack.SkillID); |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | SkillSkinConfig sscSkin = ssc.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(sscSkin.SkillMotionName)) |
| | | { |
| | | break; |
| | | } |
| | |
| | | { |
| | | HB427_tagSCUseSkill sp = combinePack.GetMainHB427SkillPack(); |
| | | SkillConfig ssc = SkillConfig.Get((int)sp.SkillID); |
| | | |
| | | if (!string.IsNullOrEmpty(ssc.SkillMotionName)) |
| | | SkillSkinConfig sscSkin = ssc.GetOriginSkinConfig(); |
| | | if (!string.IsNullOrEmpty(sscSkin.SkillMotionName)) |
| | | { |
| | | break; |
| | | } |
| | |
| | | #if UNITY_EDITOR |
| | | private void PrintHurtParamDebugInfo(BattleHurtParam hurtParam) |
| | | { |
| | | bool isLastHit = hurtParam.hitIndex >= hurtParam.skillConfig.DamageDivide.Length - 1; |
| | | bool isLastHit = hurtParam.hitIndex >= hurtParam.skillSkinConfig.DamageDivide.Length - 1; |
| | | |
| | | long currentHitDamage = hurtParam.hurter.damageList != null ? hurtParam.hurter.damageList.Sum() : 0; |
| | | long currentHitSuckHp = hurtParam.caster.suckHpList != null ? hurtParam.caster.suckHpList.Sum() : 0; |
| | |
| | | $"攻击者: {hurtParam.caster.casterObj.GetName()} (ObjID:{hurtParam.caster.casterObj.ObjID})\n" + |
| | | $"目标: {hurtParam.hurter.hurtObj.GetName()} (ObjID:{hurtParam.hurter.hurtObj.ObjID})\n" + |
| | | $"技能: {hurtParam.skillConfig.SkillName} (ID:{hurtParam.skillConfig.SkillID})\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"击数: 第{hurtParam.hitIndex + 1}击 / 共{hurtParam.skillSkinConfig.DamageDivide.Length}击" + (isLastHit ? " [最后一击]" : " [中间击]") + "\n" + |
| | | $"\n" + |
| | | $"========== 目标受伤数据 ==========\n" + |
| | | $"伤害: {currentHitDamage} / 总伤害: {totalDamage}\n" + |
| | |
| | | if (moveFinished) |
| | | { |
| | | // 如果技能有动画(SkillMotionName不为空),需要等待动画播放完成 |
| | | if (skillConfig != null && !string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | if (skillSkinConfig != null && !string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | if (!isMotionCompleted) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(skillConfig.SkillMotionName)) |
| | | if (string.IsNullOrEmpty(skillSkinConfig.SkillMotionName)) |
| | | { |
| | | return true; |
| | | } |
| | |
| | | private Vector2 end; |
| | | private Vector2 control; |
| | | |
| | | public BezierBulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer effectPlayer, |
| | | public BezierBulletCurve(BattleObject caster, SkillConfig skillConfig, SkillSkinConfig _skillSkinConfig, BattleEffectPlayer effectPlayer, |
| | | RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, hurtList, bulletIndex, onHit) { } |
| | | : base(caster, skillConfig, _skillSkinConfig, effectPlayer, target, hurtList, bulletIndex, onHit) { } |
| | | |
| | | public override void Reset() |
| | | { |
| | | base.Reset(); |
| | | start = WorldToLocalAnchoredPosition(bulletTrans.position) + bulletOffset; |
| | | end = WorldToLocalAnchoredPosition(target.position); |
| | | duration = Vector2.Distance(start, end) / skillConfig.BulletFlySpeed; |
| | | duration = Vector2.Distance(start, end) / skillSkinConfig.BulletFlySpeed; |
| | | control = (start + end) / 2 + Vector2.up * 100f; |
| | | } |
| | | |
| | |
| | | private float bounceTime = 0.2f; // 每次弹射时间 |
| | | private float bounceElapsed = 0f; |
| | | |
| | | public BounceBulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer effectPlayer, |
| | | public BounceBulletCurve(BattleObject caster, SkillConfig skillConfig, SkillSkinConfig _skillSkinConfig, BattleEffectPlayer effectPlayer, |
| | | RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, hurtList, bulletIndex, onHit) |
| | | : base(caster, skillConfig, _skillSkinConfig, effectPlayer, target, hurtList, bulletIndex, onHit) |
| | | { |
| | | this.hurtList = hurtList; |
| | | } |
| | |
| | | { |
| | | start = WorldToLocalAnchoredPosition(bulletTrans.position) + bulletOffset; |
| | | end = WorldToLocalAnchoredPosition(target.position); |
| | | duration = Vector2.Distance(start, end) / skillConfig.BulletFlySpeed; |
| | | duration = Vector2.Distance(start, end) / skillSkinConfig.BulletFlySpeed; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | protected BattleObject caster; |
| | | protected SkillConfig skillConfig; |
| | | |
| | | protected SkillSkinConfig skillSkinConfig; |
| | | protected BattleEffectPlayer bulletEffect; |
| | | protected RectTransform bulletTrans; // 子弹的RectTransform |
| | | protected RectTransform target; |
| | |
| | | |
| | | protected List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurts = new List<HB427_tagSCUseSkill.tagSCUseSkillHurt>(); |
| | | |
| | | public BulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer bulletEffect, RectTransform target, |
| | | public BulletCurve(BattleObject caster, SkillConfig skillConfig, SkillSkinConfig _skillSkinConfig, BattleEffectPlayer bulletEffect, RectTransform target, |
| | | List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | { |
| | | this.caster = caster; |
| | | this.skillConfig = skillConfig; |
| | | skillSkinConfig = _skillSkinConfig; |
| | | this.bulletEffect = bulletEffect; |
| | | this.target = target; |
| | | this.onHit = onHit; |
| | |
| | | { |
| | | finished = true; |
| | | onHit?.Invoke(mBulletIndex, hurts); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, bulletEffect); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BulletEffectId, bulletEffect); |
| | | } |
| | | |
| | | public virtual void ForceFinish() |
| | |
| | | public static BulletCurve CreateBulletCurve( |
| | | BattleObject caster, |
| | | SkillConfig skillConfig, |
| | | SkillSkinConfig _skillSkinConfig, |
| | | BattleEffectPlayer bulletEffect, |
| | | RectTransform target, |
| | | List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, |
| | |
| | | Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | { |
| | | BulletCurve curve = null; |
| | | switch (skillConfig.BulletPath) |
| | | switch (_skillSkinConfig.BulletPath) |
| | | { |
| | | case 1: // 直线消失于目标 |
| | | curve = new StraightBulletCurve(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | curve = new StraightBulletCurve(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | break; |
| | | case 2: // 直线贯穿消失在屏幕外 |
| | | curve = new PenetrateBulletCurve(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | curve = new PenetrateBulletCurve(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | break; |
| | | case 3: // 抛物线弧线 |
| | | curve = new BezierBulletCurve(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | curve = new BezierBulletCurve(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | break; |
| | | case 4: // 弹射 |
| | | curve = new BounceBulletCurve(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | curve = new BounceBulletCurve(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | break; |
| | | default: |
| | | curve = new BulletCurve(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | curve = new BulletCurve(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit); |
| | | break; |
| | | } |
| | | |
| | |
| | | private Vector2 outPos; // 屏幕外延长点(本地坐标) |
| | | private bool hitTriggered = false; // 是否已触发onHit |
| | | |
| | | public PenetrateBulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer effectPlayer, RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, effectPlayer, target, hurtList, bulletIndex, onHit) { } |
| | | public PenetrateBulletCurve(BattleObject caster, SkillConfig skillConfig, SkillSkinConfig _skillSkinConfig, BattleEffectPlayer effectPlayer, RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, _skillSkinConfig, effectPlayer, target, hurtList, bulletIndex, onHit) { } |
| | | |
| | | /// <summary> |
| | | /// 初始化弹道参数 |
| | |
| | | hitTriggered = false; |
| | | start = WorldToLocalAnchoredPosition(bulletTrans.position) + bulletOffset; |
| | | end = WorldToLocalAnchoredPosition(target.position); |
| | | duration = Vector2.Distance(start, end) / skillConfig.BulletFlySpeed; |
| | | duration = Vector2.Distance(start, end) / skillSkinConfig.BulletFlySpeed; |
| | | Vector2 dir = (end - start).normalized; |
| | | float extend = 500f; // 贯穿距离,可根据需求调整 |
| | | outPos = end + dir * extend; |
| | |
| | | private Vector2 start; |
| | | private Vector2 end; |
| | | |
| | | public StraightBulletCurve(BattleObject caster, SkillConfig skillConfig, BattleEffectPlayer bulletEffect, RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, bulletEffect, target, hurtList, bulletIndex, onHit) |
| | | public StraightBulletCurve(BattleObject caster, SkillConfig skillConfig, SkillSkinConfig _skillSkinConfig, BattleEffectPlayer bulletEffect, RectTransform target, List<HB427_tagSCUseSkill.tagSCUseSkillHurt> hurtList, int bulletIndex, Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit) |
| | | : base(caster, skillConfig, _skillSkinConfig, bulletEffect, target, hurtList, bulletIndex, onHit) |
| | | { |
| | | |
| | | } |
| | |
| | | base.Reset(); |
| | | start = WorldToLocalAnchoredPosition(bulletTrans.position) + bulletOffset; |
| | | end = WorldToLocalAnchoredPosition(target.position); |
| | | duration = Vector2.Distance(start, end) / skillConfig.BulletFlySpeed; |
| | | duration = Vector2.Distance(start, end) / skillSkinConfig.BulletFlySpeed; |
| | | // BattleUtility.MarkStartAndEnd(bulletTrans, target); |
| | | } |
| | | |
| | |
| | | private int scatterTotalTargets = 0; |
| | | |
| | | |
| | | public BulletSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _caster, _tagUseSkillAttack) |
| | | public BulletSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, SkillSkinConfig _skillSkinConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _skillSkinConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | | } |
| | |
| | | { |
| | | base.OnMiddleFrameEnd(times, index); |
| | | // 弹射 另外的做法了 |
| | | if (skillConfig.effectType == SkillEffectType.Bullet && skillConfig.BulletPath == 4) |
| | | if (skillSkinConfig.effectType == SkillEffectType.Bullet && skillSkinConfig.BulletPath == 4) |
| | | { |
| | | var hurt = tagUseSkillAttack.HurtList[0]; |
| | | BattleObject targetObject = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | |
| | | private void ShotToIndex(BattleCamp camp, int targetIndex, int bulletIndex) |
| | | { |
| | | RectTransform targetTransform = caster.battleField.GetTeamNode(camp, targetIndex); |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | |
| | | RectTransform effectTrans = effectPlayer.transform as RectTransform; |
| | | |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, targetTransform, tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) => |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, skillSkinConfig, effectPlayer, targetTransform, tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) => |
| | | { |
| | | if (isFinish) |
| | | return; |
| | | // 击中就销毁子弹 |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BulletEffectId, effectPlayer); |
| | | // 播放子弹爆炸特效 |
| | | |
| | | BattleCamp battleCamp = skillConfig.TagFriendly != 0 ? caster.Camp : caster.GetEnemyCamp(); |
| | | // 首先是目标身上爆炸 |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | |
| | | foreach (var hurt in hitList) |
| | | { |
| | |
| | | continue; |
| | | } |
| | | |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | } |
| | | |
| | | // 表现子弹飞行到目标位置 |
| | |
| | | { |
| | | scatterHitCount = 0; |
| | | // 总击中数 = 发射次数 × 目标数量 |
| | | scatterTotalTargets = skillConfig.ActiveFrames.Length * tagUseSkillAttack.HurtList.Length; |
| | | scatterTotalTargets = skillSkinConfig.ActiveFrames.Length * tagUseSkillAttack.HurtList.Length; |
| | | } |
| | | |
| | | // 处理散射逻辑 |
| | |
| | | |
| | | private void ScatterShot(BattleObject target, HB427_tagSCUseSkill.tagSCUseSkillHurt hurt, int bulletIndex, int order) |
| | | { |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | |
| | | bool shotToSelf = target.ObjID == caster.ObjID; |
| | | |
| | |
| | | |
| | | var tempOrder = order; |
| | | |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, target.GetRectTransform(), |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, skillSkinConfig, effectPlayer, target.GetRectTransform(), |
| | | new List<HB427_tagSCUseSkill.tagSCUseSkillHurt> { hurt }, bulletIndex, (index, hitList) => |
| | | { |
| | | foreach (var hurt in hitList) |
| | |
| | | continue; |
| | | } |
| | | |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | } |
| | | |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, hitList); |
| | | // 击中就销毁子弹 |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BulletEffectId, effectPlayer); |
| | | |
| | | // 增加散射击中计数 |
| | | scatterHitCount++; |
| | |
| | | |
| | | protected void ShotToTarget(BattleObject target, int bulletIndex) |
| | | { |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | BattleEffectPlayer effectPlayer = caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.BulletEffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | |
| | | bool shotToSelf = target.ObjID == caster.ObjID; |
| | | |
| | |
| | | |
| | | int tempBulletIndex = bulletIndex; |
| | | |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, effectPlayer, target.GetRectTransform(), tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) => |
| | | var bulletCurve = BulletCurveFactory.CreateBulletCurve(caster, skillConfig, skillSkinConfig, effectPlayer, target.GetRectTransform(), tagUseSkillAttack.HurtList.ToList(), bulletIndex, (index, hitList) => |
| | | { |
| | | if (skillConfig.BulletPath == 4) |
| | | if (skillSkinConfig.BulletPath == 4) |
| | | { |
| | | if (bounceHitIndex >= hitList.Count) |
| | | { |
| | |
| | | BattleObject targetObj = caster.battleField.battleObjMgr.GetBattleObject((int)hurt.ObjID); |
| | | if (targetObj != null) |
| | | { |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (bounceHitIndex >= tagUseSkillAttack.HurtList.Length) |
| | | { |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BulletEffectId, effectPlayer); |
| | | } |
| | | |
| | | if (isFinish) |
| | | return; |
| | | |
| | | if (tempBulletIndex >= skillConfig.ActiveFrames.Length - 1 && bounceHitIndex >= hitList.Count) |
| | | if (tempBulletIndex >= skillSkinConfig.ActiveFrames.Length - 1 && bounceHitIndex >= hitList.Count) |
| | | { |
| | | isFinish = true; |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | PlayExplosionEffect(skillConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffectId, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect2, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect3, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | PlayExplosionEffect(skillSkinConfig.ExplosionEffect4, targetObj.GetTransform(), caster.Camp, targetObj.GetModelScale()); |
| | | } |
| | | |
| | | // 表现子弹飞行到目标位置 |
| | | onHit?.Invoke(index, hitList); |
| | | // 击中就销毁子弹 |
| | | |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillConfig.BulletEffectId, effectPlayer); |
| | | caster.battleField.battleEffectMgr.RemoveEffect(skillSkinConfig.BulletEffectId, effectPlayer); |
| | | |
| | | if (isFinish) |
| | | return; |
| | | |
| | | if (bulletIndex >= skillConfig.ActiveFrames.Length - 1) |
| | | if (bulletIndex >= skillSkinConfig.ActiveFrames.Length - 1) |
| | | { |
| | | isFinish = true; |
| | | } |
| | |
| | | // protected BattleObject caster; |
| | | // protected List<BattleObject> targets; // 目标列表 |
| | | |
| | | public DotSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _caster, _tagUseSkillAttack) |
| | | public DotSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, SkillSkinConfig _skillSkinConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _skillSkinConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | | } |
| | |
| | | Debug.LogError($"DotSkillEffect 找不到目标,GUID={hurtInfo.ObjID}"); |
| | | continue; |
| | | } |
| | | target.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.TriggerEffect, target.GetRectTransform(), caster.Camp, target.GetModelScale()); |
| | | target.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.TriggerEffect, target.GetRectTransform(), caster.Camp, target.GetModelScale()); |
| | | } |
| | | |
| | | onHit?.Invoke(0, tagUseSkillAttack.HurtList.ToList()); |
| | |
| | | // protected BattleObject caster; |
| | | // protected List<BattleObject> targets; // 目标列表 |
| | | |
| | | public NoEffect(SkillBase _skillBase, SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _caster, _tagUseSkillAttack) |
| | | public NoEffect(SkillBase _skillBase, SkillConfig _skillConfig, SkillSkinConfig _skillSkinConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _skillSkinConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | | } |
| | |
| | | |
| | | RectTransform targetTransform = caster.battleField.GetTeamNode(battleCamp, mainTargetIndex); |
| | | |
| | | if (skillConfig.ExplosionEffectId > 0) |
| | | if (skillSkinConfig.ExplosionEffectId > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | } |
| | | |
| | | if (skillConfig.ExplosionEffect2 > 0) |
| | | if (skillSkinConfig.ExplosionEffect2 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | } |
| | | |
| | | for (int i = 0; i < tagUseSkillAttack.HurtList.Length; i++) |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (skillConfig.ExplosionEffect3 > 0) |
| | | if (skillSkinConfig.ExplosionEffect3 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillConfig.ExplosionEffect3, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillSkinConfig.ExplosionEffect3, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | } |
| | | if (skillConfig.ExplosionEffect4 > 0) |
| | | if (skillSkinConfig.ExplosionEffect4 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillConfig.ExplosionEffect4, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillSkinConfig.ExplosionEffect4, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | } |
| | | } |
| | | |
| | |
| | | // protected BattleObject caster; |
| | | // protected List<BattleObject> targets; // 目标列表 |
| | | |
| | | public NormalSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _caster, _tagUseSkillAttack) |
| | | public NormalSkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, SkillSkinConfig _skillSkinConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | : base(_skillBase, _skillConfig, _skillSkinConfig, _caster, _tagUseSkillAttack) |
| | | { |
| | | |
| | | } |
| | |
| | | |
| | | RectTransform targetTransform = caster.battleField.GetTeamNode(battleCamp, mainTargetIndex); |
| | | |
| | | if (skillConfig.ExplosionEffectId > 0) |
| | | if (skillSkinConfig.ExplosionEffectId > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.ExplosionEffectId, targetTransform, caster.Camp, 1f); |
| | | } |
| | | |
| | | if (skillConfig.ExplosionEffect2 > 0) |
| | | if (skillSkinConfig.ExplosionEffect2 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.ExplosionEffect2, targetTransform, caster.Camp, 1f); |
| | | } |
| | | |
| | | for (int i = 0; i < tagUseSkillAttack.HurtList.Length; i++) |
| | |
| | | continue; |
| | | } |
| | | |
| | | if (skillConfig.ExplosionEffect3 > 0) |
| | | if (skillSkinConfig.ExplosionEffect3 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillConfig.ExplosionEffect3, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillSkinConfig.ExplosionEffect3, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | } |
| | | if (skillConfig.ExplosionEffect4 > 0) |
| | | if (skillSkinConfig.ExplosionEffect4 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillConfig.ExplosionEffect4, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(target, skillSkinConfig.ExplosionEffect4, target.GetTransform(), caster.Camp, target.GetModelScale()); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | protected SkillBase skillBase; |
| | | protected SkillConfig skillConfig; |
| | | protected SkillSkinConfig skillSkinConfig; |
| | | protected BattleObject caster; |
| | | protected HB427_tagSCUseSkill tagUseSkillAttack;// 目标列表 |
| | | |
| | |
| | | |
| | | protected Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> onHit; |
| | | |
| | | public SkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | public SkillEffect(SkillBase _skillBase, SkillConfig _skillConfig, SkillSkinConfig _skillSkinConfig, BattleObject _caster, HB427_tagSCUseSkill _tagUseSkillAttack) |
| | | { |
| | | skillBase = _skillBase; |
| | | skillConfig = _skillConfig; |
| | | skillSkinConfig = _skillSkinConfig; |
| | | caster = _caster; |
| | | tagUseSkillAttack = _tagUseSkillAttack; |
| | | } |
| | |
| | | public virtual void Play(Action<int, List<HB427_tagSCUseSkill.tagSCUseSkillHurt>> _onHit) |
| | | { |
| | | onHit = _onHit; |
| | | if (skillConfig.EffectId > 0) |
| | | if (skillSkinConfig.EffectId > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.EffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.EffectId, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | } |
| | | if (skillConfig.EffectId2 > 0) |
| | | if (skillSkinConfig.EffectId2 > 0) |
| | | { |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.EffectId2, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.EffectId2, caster.GetRectTransform(), caster.Camp, caster.GetModelScale()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public virtual void OnMiddleFrameStart(int times) |
| | | { |
| | | if (skillConfig.MStartEffectId <= 0) |
| | | if (skillSkinConfig.MStartEffectId <= 0) |
| | | return; |
| | | // 中摇固定特效 |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillConfig.MStartEffectId, caster.GetTransform(), caster.Camp, caster.GetModelScale()); |
| | | caster.battleField.battleEffectMgr.PlayEffect(caster, skillSkinConfig.MStartEffectId, caster.GetTransform(), caster.Camp, caster.GetModelScale()); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | public static class SkillEffectFactory |
| | | { |
| | | public static SkillEffect CreateSkillEffect(SkillBase skillBase, BattleObject caster, SkillConfig skillConfig, HB427_tagSCUseSkill tagUseSkillAttack) |
| | | public static SkillEffect CreateSkillEffect(SkillBase skillBase, BattleObject caster, SkillConfig skillConfig, SkillSkinConfig skillSkinConfig, HB427_tagSCUseSkill tagUseSkillAttack) |
| | | { |
| | | |
| | | switch (skillConfig.effectType) |
| | | switch (skillSkinConfig.effectType) |
| | | { |
| | | case SkillEffectType.Bullet: |
| | | return new BulletSkillEffect(skillBase,skillConfig, caster, tagUseSkillAttack); |
| | | return new BulletSkillEffect(skillBase,skillConfig, skillSkinConfig, caster, tagUseSkillAttack); |
| | | case SkillEffectType.Direct: |
| | | return new NormalSkillEffect(skillBase, skillConfig, caster, tagUseSkillAttack); |
| | | return new NormalSkillEffect(skillBase, skillConfig, skillSkinConfig, caster, tagUseSkillAttack); |
| | | // case SkillEffectType.BuffEffect: |
| | | // return new BuffSkillEffect(skillConfig, caster, targets); |
| | | // case SkillEffectType.StageEffect: |
| | | // return new StageSkillEffect(skillConfig, caster, targets); |
| | | case SkillEffectType.DOTEffect: |
| | | return new DotSkillEffect(skillBase,skillConfig, caster, tagUseSkillAttack); |
| | | return new DotSkillEffect(skillBase,skillConfig, skillSkinConfig, caster, tagUseSkillAttack); |
| | | case SkillEffectType.NoEffect: |
| | | case SkillEffectType.None: |
| | | return new NoEffect(skillBase, skillConfig, caster, tagUseSkillAttack); |
| | | return new NoEffect(skillBase, skillConfig, skillSkinConfig, caster, tagUseSkillAttack); |
| | | default: |
| | | UnityEngine.Debug.LogError("Unknown Skill Effect Type " + skillConfig.effectType + " skill id is " + skillConfig.SkillID); |
| | | return new NoEffect(skillBase, skillConfig, caster, tagUseSkillAttack); |
| | | UnityEngine.Debug.LogError("Unknown Skill Effect Type " + skillSkinConfig.effectType + " skill id is " + skillConfig.SkillID); |
| | | return new NoEffect(skillBase, skillConfig, skillSkinConfig, caster, tagUseSkillAttack); |
| | | break; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (buffCells == null) |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | if (i < datas.Count) |
| | | { |
| | | buffCells[i].SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | buffCells[i].Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | RefreshBuffCells(buffCells, datas); |
| | | } |
| | | List<TeamHero> GetTeamHeroList(List<BattleObject> teams) |
| | | { |
| | |
| | | |
| | | public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (buffCells == null) |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | if (i < datas.Count) |
| | | { |
| | | buffCells[i].SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | buffCells[i].Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | RefreshBuffCells(buffCells, datas); |
| | | } |
| | | |
| | | bool IsOpenBattleChangeTab() |
| | |
| | | } |
| | | } |
| | | |
| | | void Awake() |
| | | { |
| | | LoadPrefab(); |
| | | } |
| | | // void Start() |
| | | // { |
| | | // LoadPrefab(); |
| | | // } |
| | | |
| | | GameObject cellContainer; |
| | | |
| | |
| | | /// </summary> |
| | | public void Run() |
| | | { |
| | | if (!gameObject.activeSelf || !ValidateConfig()) |
| | | if (!ValidateConfig()) |
| | | return; |
| | | |
| | | // 检查是否完成 |
| | |
| | | |
| | | public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (battleObject.battleField.battleSwitch.BuffIcon && datas != null && datas.Count > 0) |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | if (i < datas.Count) |
| | | { |
| | | buffCells[i].SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | buffCells[i].Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | RefreshBuffCells(buffCells, datas); |
| | | |
| | | // check shield buff |
| | | var buffMgr = battleObject.GetBuffMgr(); |
| | |
| | | // Debug.LogError($"[BattleHeroInfoBar.RefreshBuff] 设置护盾 - curHp: {curHp}, shieldValue: {shieldValue}, maxHp: {maxHp}, shield1前: {oldShield1Value}, shield1后: {shield1Value}, shield2前: {oldShield2Value}, shield2后: {shield2Value}"); |
| | | } |
| | | |
| | | |
| | | protected void RefreshBuffCells(List<BattleBuffCell> cells, List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (datas == null) |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | cells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (battleObject.battleField.battleSwitch.BuffIcon) |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | var cell = cells[i]; |
| | | if (i < datas.Count) |
| | | { |
| | | cell.SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | cell.Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | cell.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < cells.Count; i++) |
| | | { |
| | | cells[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加飘字到队列(非伤害飘字) |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public void ShowTips(TipsInfo tipsInfo) |
| | | { |
| | | if (battleObject.battleField.battleSwitch.NonDamageTips) |
| | | // BUFF飘字 |
| | | if (tipsInfo.useBuffColor) |
| | | { |
| | | messages.Add(tipsInfo); |
| | | if (battleObject.battleField.battleSwitch.BuffAction) |
| | | { |
| | | messages.Add(tipsInfo); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 非伤害飘字 |
| | | if (battleObject.battleField.battleSwitch.NonDamageTips) |
| | | { |
| | | messages.Add(tipsInfo); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | messages.Clear(); |
| | | |
| | | foreach (var tip in tipsList) |
| | | for (int i = tipsList.Count - 1; i >= 0; i--) |
| | | { |
| | | tip.OnFinish = null; |
| | | GameObject.DestroyImmediate(tip.gameObject); |
| | | RemoveTips(tipsList[i]); |
| | | } |
| | | |
| | | tipsList.Clear(); |
| | |
| | | |
| | | public void RefreshBuff(List<HB428_tagSCBuffRefresh> datas) |
| | | { |
| | | if (buffCells == null) |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < buffCells.Count; i++) |
| | | { |
| | | if (i < datas.Count) |
| | | { |
| | | buffCells[i].SetActive(true); |
| | | HB428_tagSCBuffRefresh buffData = datas[i]; |
| | | SkillConfig skillConfig = SkillConfig.Get((int)buffData.SkillID); |
| | | buffCells[i].Init(buffData, () => |
| | | { |
| | | // 点击buff图标 显示buff描述/当前身上所有buff |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | buffCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | RefreshBuffCells(buffCells, datas); |
| | | } |
| | | |
| | | bool IsOpenBattleChangeTab() |
| | |
| | | |
| | | public partial class BeautyMMManager : GameSystemManager<BeautyMMManager> |
| | | { |
| | | public byte m_Energy; //剩余体力 |
| | | public int m_Energy; //剩余体力 |
| | | public uint m_EnergyTime; //上次恢复体力时间戳 |
| | | public uint m_TravelCnt; //累计游历次数 |
| | | public byte m_SceneryType; //景观类型 |
| | |
| | | |
| | | public void UpdateTravelInfo(HB040_tagSCTravelInfo netPack) |
| | | { |
| | | m_Energy = netPack.Energy; |
| | | m_Energy = (int)netPack.Energy; |
| | | m_EnergyTime = netPack.EnergyTime; |
| | | m_TravelCnt = netPack.TravelCnt; |
| | | m_SceneryType = netPack.SceneryType; |
| | |
| | | public void UpdateBeautyMMData(HB130_tagSCBeautyInfo data) |
| | | { |
| | | int activeMMID = 0; |
| | | int activeSkinID = 0; |
| | | foreach (var beauty in data.BeautyList) |
| | | { |
| | | if (DTC0403_tagPlayerLoginLoadOK.finishedLogin) |
| | | if (data.Count == 1) |
| | | { |
| | | //data.Count == 1 可以理解为解锁回报 |
| | | if (beautyMMDataDict.ContainsKey(beauty.BeautyID)) |
| | | { |
| | | if (beautyMMDataDict[beauty.BeautyID].State != beauty.State) |
| | |
| | | |
| | | foreach (var skin in beauty.SkinList) |
| | | { |
| | | if (data.Count == 1) |
| | | { |
| | | //data.Count == 1 可以理解为解锁回报 |
| | | if (beautyMMSkinDataDict.ContainsKey(skin.SkinID)) |
| | | { |
| | | if (beautyMMSkinDataDict[skin.SkinID].State != skin.State) |
| | | { |
| | | activeSkinID = skin.SkinID; |
| | | } |
| | | } |
| | | else if (skin.State != 0) |
| | | { |
| | | activeSkinID = skin.SkinID; |
| | | } |
| | | } |
| | | |
| | | beautyMMSkinDataDict[skin.SkinID] = new BeautyMMSkinData() |
| | | { |
| | | State = skin.State, |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMActiveWin>(activeMMID); |
| | | } |
| | | else if (activeSkinID > 0) |
| | | { |
| | | UIManager.Instance.OpenWindow<BeautyMMSkinActiveWin>(activeSkinID); |
| | | } |
| | | } |
| | | |
| | | //0 全部 1 已激活 2 未激活 |
| | |
| | | [SerializeField] Button leftBtn; |
| | | [SerializeField] Button rightBtn; |
| | | [SerializeField] Button skinBtn; |
| | | [SerializeField] Image skinRedImg; |
| | | |
| | | [SerializeField] Transform trainRect; |
| | | [SerializeField] Transform activeRect; |
| | |
| | | loveScroller.OnRefreshCell += OnRefreshCell; |
| | | BeautyMMManager.Instance.OnBeautyMMDataUpdate += OnBeautyMMDataUpdate; |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | |
| | | |
| | | Display(true); |
| | | } |
| | | |
| | |
| | | |
| | | needExp = nextLVConfig.LVNeedExp; |
| | | expText.text = (mmData != null ? mmData.Exp.ToString() : "0") + "/" + needExp; |
| | | process.fillAmount = mmData != null ? mmData.Exp*1.0f / needExp : 0; |
| | | process.fillAmount = mmData != null ? mmData.Exp * 1.0f / needExp : 0; |
| | | showAwardCell.SetActive(true); |
| | | int itemID = nextLVConfig.AwardItemList[0][0]; |
| | | showAwardCell.Init(new ItemCellModel(itemID, false, nextLVConfig.AwardItemList[0][1])); |
| | |
| | | |
| | | ShowTalent(); |
| | | nextLVTalentTipRect.SetActive(isActive); |
| | | nextLVTalentTip.text = Language.Get("BeautyMM26", (beforeRank + 1)* BeautyMMManager.Instance.needLVForTalent); |
| | | nextLVTalentTip.text = Language.Get("BeautyMM26", (beforeRank + 1) * BeautyMMManager.Instance.needLVForTalent); |
| | | giftOPRect.SetActive(true); |
| | | fullRect.SetActive(false); |
| | | } |
| | |
| | | BeautyMMManager.Instance.selectLoveItemID = itemlist[0]; |
| | | } |
| | | CreateScroller(); |
| | | |
| | | skinRedImg.SetActive(BeautyMMManager.Instance.IsMMSkinRed(mmID)); |
| | | } |
| | | |
| | | |
| | |
| | | if (cnt == 0) |
| | | { |
| | | ItemTipUtility.Show(BeautyMMManager.Instance.selectLoveItemID, true); |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(5, PackType.Item, BeautyMMManager.Instance.selectLoveItemID, 1); |
| | | return; |
| | | } |
| | | //使用到可升级的数量,或者总数 |
| | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | roleUPEffect.Play(); |
| | | SysNotifyMgr.Instance.ShowTip("BeautyMM2", mmConfig.Name, useCnt * value); |
| | | |
| | | // 如果正好消耗完,不触发固定概率的判定 |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(5, PackType.Item, BeautyMMManager.Instance.selectLoveItemID, onekeyToggle.isOn ? useCnt : 1)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(5, PackType.Item, BeautyMMManager.Instance.selectLoveItemID, onekeyToggle.isOn ? useCnt : 1); |
| | | } |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class BeautyMMSkinActiveWin : UIBase |
| | | { |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] ImageEx roleImg; |
| | | |
| | | [SerializeField] Text attrText; |
| | | |
| | | int skinID; |
| | | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | skinID = functionOrder; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | |
| | | void Display() |
| | | { |
| | | var skinConfig = BeautySkinConfig.Get(skinID); |
| | | nameText.text = skinConfig.Name; |
| | | roleImg.SetOrgSprite(skinConfig.BigRole, "BeautyMMBigRole"); |
| | | roleImg.SetNativeSize(); |
| | | |
| | | string format = "{0}" + UIHelper.AppendColor(TextColType.NavyYellow, "+{1}"); |
| | | attrText.text = PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0], format); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/BeautyMM/BeautyMMSkinActiveWin.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 25e9d541898b482469cf32bf0533a66b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | var skinData = BeautyMMManager.Instance.GetSkinData(skinID); |
| | | var mmData = BeautyMMManager.Instance.GetBeautyMMData(mmID); |
| | | var state = skinData.State; |
| | | if (mmData != null && mmData.State != 0 && skinConfig.UnlockWay == 1) |
| | | { |
| | | state = 1; |
| | | } |
| | | // if (mmData != null && mmData.State != 0 && skinConfig.UnlockWay == 1) |
| | | // { |
| | | // //默认签到自己解锁 |
| | | // state = 1; |
| | | // } |
| | | if (state != 0) |
| | | { |
| | | lockObj.SetActive(false); |
| | |
| | | } |
| | | usedText.SetActive(skinData.Used == 1); |
| | | selectImg.SetActive(BeautyMMManager.Instance.selectSkinID == skinID); |
| | | redImg.SetActive(redState > 0); |
| | | |
| | | redImg.SetActive(mmData != null && mmData.State != 0 && redState > 0); |
| | | |
| | | btn.AddListener(() => |
| | | { |
| | |
| | | mmID = functionOrder; |
| | | BeautyMMManager.Instance.selectSkinID = BeautyMMManager.Instance.GetUsedSkinID(mmID); |
| | | clothesScroller.OnRefreshCell += OnRefreshCell; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange += Display; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange += OnSelectSkinIDChange; |
| | | BeautyMMManager.Instance.OnBeautyMMDataUpdate += OnSelectSkinIDChange; |
| | | CreateScroller(); |
| | | Display(); |
| | | } |
| | |
| | | protected override void OnPreClose() |
| | | { |
| | | clothesScroller.OnRefreshCell -= OnRefreshCell; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange -= Display; |
| | | BeautyMMManager.Instance.OnSelectSkinIDChange -= OnSelectSkinIDChange; |
| | | BeautyMMManager.Instance.OnBeautyMMDataUpdate -= OnSelectSkinIDChange; |
| | | } |
| | | |
| | | void OnSelectSkinIDChange() |
| | | { |
| | | clothesScroller.m_Scorller.RefreshActiveCellViews(); |
| | | Display(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | |
| | | if (skinData.State == 0) |
| | | { |
| | | attrTipText.text = Language.Get("PhantasmPavilion11"); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.lightYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0])); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.NavyYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], skinConfig.InitAttrValueList[0])); |
| | | } |
| | | else |
| | | { |
| | | attrTipText.text = Language.Get("PhantasmPavilion07"); |
| | | var value = skinConfig.InitAttrValueList[0] + skinData.Star * skinConfig.AttrPerStarAddList[0]; |
| | | |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.lightYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], value)) + |
| | | Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.Green, "+" + PlayerPropertyConfig.GetValueDescription(skinConfig.AttrIDList[0], skinConfig.AttrPerStarAddList[0]))); |
| | | attrValueText.text = UIHelper.AppendColor(TextColType.NavyYellow, PlayerPropertyConfig.GetFullDescription(skinConfig.AttrIDList[0], value)) + |
| | | Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.LightGreen, "+" + PlayerPropertyConfig.GetValueDescription(skinConfig.AttrIDList[0], skinConfig.AttrPerStarAddList[0]))); |
| | | } |
| | | } |
| | | |
| | |
| | | if (BeautyMMManager.Instance.m_Energy == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("BeautyMM4"); |
| | | |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(5, BeautyMMManager.Instance.m_Energy, 1); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 如果正好消耗完,不触发固定概率的判定 |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(5, BeautyMMManager.Instance.m_Energy, 1)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(5, BeautyMMManager.Instance.m_Energy, 1); |
| | | } |
| | | |
| | | if (grid.EventID == (int)GirdEventType.Empty) |
| | | { |
| | | // 空格子 |
| | |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class GuildRankWin : UIBase |
| | | { |
| | | [SerializeField] Transform empty; |
| | | [SerializeField] GuildTop3Cell[] guildTop3Cells; |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] TextEx rankText; |
| | | [SerializeField] TextEx rankValueText; |
| | | [SerializeField] ButtonEx serversBtn; |
| | | |
| | | GuildManager manager { get { return GuildManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | serversBtn.AddListener(() => |
| | | { |
| | | UIHelper.ShowServersPanel(GuildManager.Instance.crossServerIDList); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | manager.OnRefreshFairyList += OnRefreshFairyList; |
| | |
| | | |
| | | public void Display() |
| | | { |
| | | serversBtn.SetActive(GuildManager.Instance.zoneID != 0); |
| | | ShowTop3(); |
| | | CreateScroller(); |
| | | ShowMyRank(); |
| | |
| | | |
| | | void CreateScroller() |
| | | { |
| | | scroller.Refresh(); |
| | | var cnt = manager.rankShowMaxCnt; |
| | | for (int i = 3; i < cnt; i++) |
| | | if (GuildManager.Instance.pageIndexList.Count < 4) |
| | | { |
| | | empty.SetActive(true); |
| | | scroller.SetActive(false); |
| | | return; |
| | | } |
| | | empty.SetActive(false); |
| | | scroller.SetActive(true); |
| | | |
| | | var startCount = scroller.GetCellTotalCount(); |
| | | if (startCount > GuildManager.Instance.pageIndexList.Count) |
| | | { |
| | | scroller.Refresh(); |
| | | } |
| | | for (int i = startCount + 3; i < GuildManager.Instance.pageIndexList.Count; i++) |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | |
| | | |
| | | void ShowMyRank() |
| | | { |
| | | var mydata = manager.GetFairyData(PlayerDatas.Instance.fairyData.fairy.FamilyID); |
| | | if (mydata == null) |
| | | { |
| | | rankValueText.SetActive(false); |
| | | rankText.text = Language.Get("GuildRank04", Language.Get("L1045")); |
| | | return; |
| | | } |
| | | rankValueText.SetActive(true); |
| | | rankText.text = Language.Get("GuildRank04", mydata.Rank); |
| | | rankValueText.text = UIHelper.ReplaceLargeArtNum(mydata.totalFightPower); |
| | | int myFairyRank = manager.myFairyRank; |
| | | rankText.text = Language.Get("GuildRank04", myFairyRank > 0 ? myFairyRank : Language.Get("L1045")); |
| | | rankValueText.SetActive(PlayerDatas.Instance.fairyData.HasFairy && myFairyRank > 0); |
| | | rankValueText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.fairyData.fairy.totalFightPower); |
| | | } |
| | | |
| | | void OnRefreshFairyList() |
| | | { |
| | | ShowTop3(); |
| | | scroller.m_Scorller.RefreshActiveCellViews(); |
| | | CreateScroller(); |
| | | ShowMyRank(); |
| | | } |
| | | } |
| | |
| | | BoneFieldManager.Instance.SendBBeginFBWipeOut(BoneFieldManager.Instance.DataMapID, (int)fbInfo1.PassLineID); |
| | | break; |
| | | case 2: |
| | | |
| | | if (!DungeonManager.Instance.TryGetFBInfoByMapID(TianziBillboradManager.Instance.DataMapID, out var fbInfo2)) |
| | | return; |
| | | SendGetReward(ADID); |
| | |
| | | HeroUIManager.Instance.selectCallType = HappXBTitle.HeroCallAdvanced; |
| | | HeroUIManager.Instance.selectCallIndex = 0; |
| | | SendGetReward(ADID); |
| | | TimingGiftManager.Instance.TryAddWhenAllAdsUsed(2, ADID); |
| | | }); |
| | | break; |
| | | case 4: |
| | | case 6: |
| | | TimingGiftManager.Instance.TryAddWhenAllAdsUsed(1, ADID); |
| | | SendGetReward(ADID); |
| | | break; |
| | | case 5: |
| | | TimingGiftManager.Instance.TryAddWhenAllAdsUsed(7, ADID); |
| | | GubaoManager.Instance.selectCallIndex = 0; |
| | | SendGetReward(ADID); |
| | | break; |
| | | case 6: |
| | | SendGetReward(ADID); |
| | | break; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.OpenWindow<TowerBaseWin>(); |
| | | } |
| | | } |
| | | |
| | |
| | | TalkData data = hasNewPlayerInfo ? newPlayerInfo : nowData; |
| | | |
| | | avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)data.PlayerID, (int)data.Face, (int)data.FacePic, data.Job)); |
| | | |
| | | |
| | | title.InitUI(data.RealmLV, (int)data.TitleID); |
| | | int bubbleID = ChatBubbleHelper.GetOtherChatBubbleID(data.Job, (int)data.BubbleBox); |
| | | m_ChatBubble.DisplayBubble(bubbleID, (int)data.PlayerID); |
| | |
| | | } |
| | | m_PlayerName.text = Language.Get("Chat08", RichTextMsgReplaceConfig.GetRichReplace("FAMILY", fmlv), data.Name); |
| | | } |
| | | |
| | | avatarCell.SetListener(() => |
| | | { |
| | | AvatarHelper.TryViewOtherPlayerInfo((int)data.PlayerID, serverID: (int)data.ServerID, viewPlayerLineupType: (int)BattlePreSetType.Arena); |
| | | }); |
| | | } |
| | | |
| | | public float GetHeight(string content, ArrayList list) |
| | |
| | | [SerializeField] Image moneyTypeImg; |
| | | [SerializeField] Button adBtn; |
| | | [SerializeField] Button useMoneyBtn; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | AdsManager.Instance.PlayAds(4); |
| | | CloseWindow(); |
| | | TimingGiftManager.Instance.TryAddWhenExactConsumption(1, BlessLVManager.Instance.m_Energy, 1); |
| | | } |
| | | |
| | | |
| | | void OnUseMoney() |
| | | { |
| | | CloseWindow(); |
| | |
| | | |
| | | void OnTimeEvent() |
| | | { |
| | | if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) |
| | | { |
| | | return; |
| | | } |
| | | //升级中检查 倒计时结束;非升级中检查免费次数时间 红点 |
| | | if (m_LVUPState == 1) |
| | | { |
| | |
| | | } |
| | | |
| | | void OnTimeEvent() |
| | | { |
| | | { |
| | | var remainTime = BlessLVManager.Instance.GetLVUPRemainTime(); |
| | | int needCount = (int)Math.Ceiling((float)remainTime / BlessLVManager.Instance.timeUpTreeItemSubTime); |
| | | RefreshCount(needCount, remainTime); |
| | |
| | | CloseWindow(); |
| | | int count = (int)PackManager.Instance.GetItemCountByID(PackType.Item, BlessLVManager.Instance.timeUpTreeItemID); |
| | | if (count <= 0) |
| | | { |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("ItemNotEnoughCommon"); |
| | | ItemTipUtility.Show(BlessLVManager.Instance.timeUpTreeItemID, true); |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(1,PackType.Item, BlessLVManager.Instance.timeUpTreeItemID, showCount); |
| | | return; |
| | | } |
| | | |
| | | TimingGiftManager.Instance.TryAddWhenExactConsumption(1,PackType.Item, BlessLVManager.Instance.timeUpTreeItemID, showCount); |
| | | |
| | | var pack = new CB224_tagCMUseTreeLVUPTimeItem(); |
| | | pack.UseCount = (uint)showCount; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | |
| | | [SerializeField] MoneyMoveByPath moneyMoveByPathCell; //掉落物金钱
|
| | | [SerializeField] RectTransform defaultDropRect; //默认掉落位置
|
| | | [SerializeField] Text[] expTexts;
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[20]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[20]; //掉落货币,金钱,经验等
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[100]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[100]; //掉落货币,金钱,经验等
|
| | |
|
| | |
|
| | | void Awake()
|
| | |
| | | /// </summary> |
| | | public class GubaoCallWin : UIBase |
| | | { |
| | | [SerializeField] TimingGiftCell timingGiftCell; |
| | | [SerializeField] OwnItemCell ownItemCell; |
| | | [SerializeField] Toggle skipToggle; |
| | | [SerializeField] Button call1Btn; |
| | |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += Display; |
| | | HappyXBModel.Instance.RefreshXBResultAct += ShowResult; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent; |
| | | skipToggle.isOn = LocalSave.GetBool(GubaoManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); |
| | | opObj.SetActive(true); |
| | | resultObj.SetActive(false); |
| | | |
| | | timingGiftCell.InitUI(); |
| | | |
| | | ShowVenderTalk(0).Forget(); |
| | | Display(); |
| | | } |
| | |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct -= Display; |
| | | HappyXBModel.Instance.RefreshXBResultAct -= ShowResult; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent; |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | | { |
| | | timingGiftCell.InitUI(); |
| | | } |
| | | |
| | | |
| | |
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, lvConfig.LVUPNeedItemInfo[0][0]) < lvConfig.LVUPNeedItemInfo[0][1]) |
| | | { |
| | | ItemTipUtility.Show(lvConfig.LVUPNeedItemInfo[0][0], true); |
| | | GubaoTryAdd(lvConfig.LVUPNeedItemInfo[0][0], lvConfig.LVUPNeedItemInfo[0][1]); |
| | | return; |
| | | } |
| | | |
| | | lvupEffect.Play(); |
| | | GubaoTryAdd(lvConfig.LVUPNeedItemInfo[0][0], lvConfig.LVUPNeedItemInfo[0][1]); |
| | | GubaoManager.Instance.UpgradeGubaoLV(gubaoID); |
| | | } |
| | | |
| | |
| | | GubaoManager.Instance.ActiveGubao(gubaoID); |
| | | } |
| | | |
| | | void GubaoTryAdd(int itemId, long needCount) |
| | | { |
| | | int timingType = itemId switch |
| | | { |
| | | 21 => 8, // 地脉粉尘 |
| | | 27 => 9, // 星辉粉尘 |
| | | 28 => 10, // 月华粉尘 |
| | | 29 => 11, // 日曜粉尘 |
| | | _ => -1 // 默认值 |
| | | }; |
| | | |
| | | if (timingType >= 0) |
| | | { |
| | | if (TimingGiftManager.Instance.TryAddWhenInsufficient(timingType,PackType.Item, itemId, needCount)) |
| | | return; |
| | | if (TimingGiftManager.Instance.TryAddWhenExactConsumption(timingType, PackType.Item,itemId, needCount)) |
| | | return; |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(timingType, PackType.Item,itemId, needCount); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (PlayerDatas.Instance.fairyData.fairy == null) |
| | | return; |
| | | |
| | | GuildManager.Instance.RequestGuildData(); |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | GlobalTimeEvent.Instance.fiveSecondEvent += OnFiveSecondEvent; |
| | | ChatManager.Instance.OnUpdateTalkEvent += OnUpdateTalkEvent; |
| | |
| | | |
| | | void Display() |
| | | { |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); |
| | | headCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, |
| | | PlayerDatas.Instance.baseData.face, |
| | |
| | | bzAttrText.text = GetAddAttrs(bossAction); |
| | | var layer = bossAction == null ? 0 : bossAction.Value3; |
| | | var bzTime = bossAction == null ? 0 : bossAction.Value2; |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.AllSeconds); |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID)); |
| | | if (remainTime == 0) |
| | | { |
| | | //时间到了 客户端自己清0 |
| | |
| | | { |
| | | var layerNum = action == null ? 0 : action.Value3; |
| | | var bzTime = action == null ? 0 : action.Value2; |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.AllSeconds); |
| | | int remainTime = (int)Math.Max(0, bzTime - TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID)); |
| | | if (remainTime == 0) |
| | | { |
| | | //时间到了 客户端自己清0 |
| | |
| | | |
| | | void OnSecondEvent() |
| | | { |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | endTimeText.text = Language.Get("Arena14", TimeUtility.SecondsToHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | var bossAction = GuildBossManager.Instance.GetGuildBossAction(); |
| | | ShowBzInfo(bossAction); |
| | | OtherPlayerAnimation(); |
| | |
| | | |
| | | void ShowTime() |
| | | { |
| | | if (GuildManager.Instance.TryGetFamilyActions(GuildManager.CustomyActionType, out var familyActions)) |
| | | if (PlayerDatas.Instance.fairyData.fairy != null) |
| | | { |
| | | var lastTime = familyActions.IsNullOrEmpty() ? 0 : familyActions[0].Value1; |
| | | var cdTime = GuildManager.Instance.renameFairyNameCD * 3600 - (TimeUtility.AllSeconds - (int)lastTime); |
| | | var lastTime = PlayerDatas.Instance.fairyData.fairy.lastChangeNameTick; |
| | | var cdTime = GuildManager.Instance.renameFairyNameCD * 3600 - (TimeUtility.AllSeconds - lastTime); |
| | | if (cdTime <= 0) |
| | | { |
| | | cdTimeText.text = Language.Get("Guild_51", GuildManager.Instance.renameFairyNameCD); |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.RequestGuildData(); |
| | | |
| | | GuildManager.Instance.memberOPIndex = -1; |
| | | GuildManager.Instance.MemberOPIndexEvent += OnMemberOPIndexEvent; |
| | |
| | | |
| | | void OnSecondEvent() |
| | | { |
| | | timeText.text = Language.Get("Guild_74", TimeUtility.SecondsToShortDHMS((int)(TimeUtility.GetTodayEndTime() - TimeUtility.ServerNow).TotalSeconds)); |
| | | timeText.text = Language.Get("Guild_74", TimeUtility.SecondsToShortDHMS((int)(TimeUtility.GetCommTodayEndTime(GuildManager.Instance.zoneID) - |
| | | TimeUtility.GetCommServerNow(GuildManager.Instance.zoneID)).TotalSeconds)); |
| | | } |
| | | |
| | | int index = 0; |
| | |
| | | void OnCut() |
| | | { |
| | | //砍价的cd限制: 公会没有记录自己砍过价,但今天有砍价记录,且退出过公会 |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0 && GuildManager.Instance.needCheckCutCD && (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60 < GuildManager.Instance.zbgChangFamilyCD ) |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0 && GuildManager.Instance.needCheckCutCD && (TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60 < GuildManager.Instance.zbgChangFamilyCD ) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("ZhenbaogeCut1", GuildManager.Instance.zbgChangFamilyCD - (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60); |
| | | SysNotifyMgr.Instance.ShowTip("ZhenbaogeCut1", GuildManager.Instance.zbgChangFamilyCD - (TimeUtility.GetCommServerTick(GuildManager.Instance.zoneID) - PlayerDatas.Instance.baseData.leaveFamilyTime) / 60); |
| | | return; |
| | | } |
| | | if (GuildManager.Instance.zhenbaogeCutState == 0) |
| | |
| | | [SerializeField] Button quicklyJoinGuildBtn; |
| | | [SerializeField] ScrollerController guildListScroller; |
| | | [SerializeField] Transform noGuildTf; |
| | | [SerializeField] Button serversBtn; |
| | | |
| | | string lastQuery = ""; |
| | | int lastPage = 0; |
| | |
| | | findBtn.AddListener(() => OnFindBtnClick()); |
| | | createGuildBtn.AddListener(OnCreateGuildBtnClick); |
| | | quicklyJoinGuildBtn.AddListener(OnQuicklyJoinGuildBtnClick); |
| | | serversBtn.AddListener(()=> |
| | | { |
| | | UIHelper.ShowServersPanel(GuildManager.Instance.crossServerIDList); |
| | | }); |
| | | } |
| | | protected override void OnPreOpen() |
| | | { |
| | |
| | | |
| | | void Display() |
| | | { |
| | | serversBtn.SetActive(GuildManager.Instance.zoneID != 0); |
| | | CreateScroller(); |
| | | } |
| | | |
| New file |
| | |
| | |
|
| | |
|
| | | // 跨服公会
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | public partial class GuildManager : GameSystemManager<GuildManager>
|
| | | {
|
| | | public int zoneID;
|
| | | public List<int> crossServerIDList = new List<int>();
|
| | | public event Action OnRefreshCrossServerInfoEvent;
|
| | |
|
| | | public void OnRefreshCrossServerInfo(HA505_tagSCFamilyCrossInfo vNetData)
|
| | | {
|
| | | zoneID = vNetData.ZoneID;
|
| | | crossServerIDList.Clear();
|
| | | for (int i = 0; i < vNetData.ServerCnt; i++)
|
| | | {
|
| | | crossServerIDList.Add((int)vNetData.ServerIDList[i]);
|
| | | }
|
| | | crossServerIDList.Sort();
|
| | | OnRefreshCrossServerInfoEvent?.Invoke();
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | }
|
| | |
|
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/Guild/GuildManager.CrossServer.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 60391b6aaece70d44818911cfde90870 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using UnityEngine;
|
| | |
|
| | |
|
| | | public class GuildManager : GameSystemManager<GuildManager>
|
| | | public partial class GuildManager : GameSystemManager<GuildManager>
|
| | | {
|
| | | // 家族自定义记录类型
|
| | | public const int CustomyActionType = 0; //通用
|
| | | public const int MemberChangeActionType = 12; //公会变更记录
|
| | | public const int FamilyActionsType = 15; // 公会记录徽章类型15
|
| | | public const int ZBGFamilyActionType = 16; // 珍宝阁记录类型
|
| | |
| | |
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | zoneID = 0;
|
| | | crossServerIDList.Clear();
|
| | | ClearGuildData();
|
| | | donateCntList = null;
|
| | | }
|
| | |
|
| | | void OnBeforePlayerDataInitializeEx()
|
| | | {
|
| | | guildChanged = false;
|
| | | isQueryZBGYet = false;
|
| | | }
|
| | |
|
| | |
| | | PlayerDatas.Instance.baseData.FamilyId = 0;
|
| | | m_FairyRequesteds.Clear();
|
| | | familyActions.Clear();
|
| | | guildChanged = false;
|
| | | applyList.Clear();
|
| | | PlayerDatas.Instance.fairyData.ClearData();
|
| | |
|
| | |
| | |
|
| | |
|
| | | config = FuncConfigConfig.Get("FamilyBillboardSet");
|
| | | rankShowMaxCnt = int.Parse(config.Numerical1);
|
| | | pageCnt = int.Parse(config.Numerical2);
|
| | | pageCnt = int.Parse(config.Numerical1);
|
| | | queryPointNum = int.Parse(config.Numerical2);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | punishTime = quitGuildPunishTime[Math.Min(quitCount, quitGuildPunishTime.Length - 1)];
|
| | | }
|
| | |
|
| | | return punishTime * 60 - (TimeUtility.AllSeconds - PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | return punishTime * 60 - (TimeUtility.GetCommServerTick(zoneID)- PlayerDatas.Instance.baseData.leaveFamilyTime);
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | // 查找的公会ID:公会数据
|
| | | public Dictionary<int, FairyData> guildsDict = new Dictionary<int, FairyData>();
|
| | | public int myFairyRank;
|
| | | // 按查询页存储
|
| | | public List<int> pageIndexList = new List<int>(); //正常是按页查询,顺序添加即可
|
| | | public int curPageIndex;
|
| | |
| | | public int lastPage = -1;
|
| | | public int pageCnt; //每页查询条数
|
| | | int queryPointNum; //查询点
|
| | | public int rankShowMaxCnt;
|
| | |
|
| | | public bool isPowerSort
|
| | | {
|
| | |
| | | if (lastPage >= page)
|
| | | return;
|
| | | lastPage = page;
|
| | |
|
| | | if (index >= rankShowMaxCnt)
|
| | | {
|
| | | //超过服务器已上榜的总数量,比如总榜单是100名,当前只有8名玩家上榜,往下滚动就不再查询
|
| | | return;
|
| | | }
|
| | | //Debug.LogFormat("分页查询:请求第 {0} 页 (当前index:{1})", page + 1, index);
|
| | | SendFindGuild(string.Empty, page + 1, pageCnt);
|
| | | }
|
| | | }
|
| | |
| | | SetFairyViewData(data, guildInfo);
|
| | | pageIndexList.Add((int)guildInfo.FamilyID);
|
| | | }
|
| | |
|
| | | myFairyRank = (int)vNetData.Rank; //0-没有公会或没有在榜上;>0-对应排名
|
| | |
|
| | | if (OnRefreshFairyList != null)
|
| | | {
|
| | |
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public void SendFindGuildNoDecrypt(string msg, int pageIndex = 0, int pageSize = 20)
|
| | | {
|
| | | if (pageIndex == 0)
|
| | | {
|
| | | //默认查询第一页即代表重新开始查询,清空之前的数据
|
| | | guildsDict.Clear();
|
| | | pageIndexList.Clear();
|
| | | }
|
| | | var pack = new CA620_tagCMViewFamilyPage();
|
| | | pack.Msg = msg;
|
| | | pack.MsgLen = (byte)msg.Length;
|
| | | pack.PageIndex = (byte)pageIndex;
|
| | | pack.ShowCount = (byte)pageSize;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA523_tagMCFamilyViewList.tagMCFamilyView view)
|
| | | {
|
| | | data.Rank = view.Rank;
|
| | | data.FamilyID = (int)view.FamilyID;
|
| | | data.FamilyName = view.FamilyName;
|
| | | data.LeaderID = (int)view.LeaderID;
|
| | | data.LeaderServerID = (int)view.LeaderServerID;
|
| | | data.LeaderName = view.LeaderName;
|
| | | data.FamilyLV = view.FamilyLV;
|
| | | data.JoinReview = view.JoinReview;
|
| | |
| | | data.MemberCount = view.MemberCount;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 查看目标公会
|
| | | public Dictionary<int, FairyData> viewGuildsDict = new Dictionary<int, FairyData>();
|
| | |
|
| | | public event Action OnUpdateViewFamilyInfo;
|
| | |
|
| | | public void UpdateViewFamilyInfo(HA519_tagSCTagFamilyInfo pack)
|
| | | {
|
| | | FairyData data = new FairyData();
|
| | | SetFairyViewData(data, pack);
|
| | | viewGuildsDict[(int)data.FamilyID] = data;
|
| | | OnUpdateViewFamilyInfo?.Invoke();
|
| | | }
|
| | |
|
| | | public static void SetFairyViewData(FairyData data, HA519_tagSCTagFamilyInfo view)
|
| | | {
|
| | | data.FamilyID = (int)view.FamilyID;
|
| | | data.FamilyName = view.FamilyName;
|
| | | data.LeaderID = (int)view.LeaderID;
|
| | | data.LeaderServerID = (int)view.LeaderServerID;
|
| | | data.LeaderName = view.LeaderName;
|
| | | data.FamilyLV = view.FamilyLV;
|
| | | data.ServerID = (int)view.ServerID;
|
| | | data.EmblemID = (int)view.EmblemID;
|
| | | data.EmblemWord = view.EmblemWord;
|
| | | data.totalFightPower = view.FightPowerEx * Constants.ExpPointValue + view.FightPower;
|
| | | data.MemberCount = view.MemberCount;
|
| | | }
|
| | |
|
| | | public void SendViewGuild(int fairyID, int serverID)
|
| | | {
|
| | | var pack = new CA619_tagCSViewTagFamily();
|
| | | pack.FamilyID = (uint)fairyID;
|
| | | pack.DataServerID = (uint)serverID;
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 申请列表
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | float lastChangeMarkTime = 0; //打开界面情况下避免短时间多次立即请求,C/S通信也是有时间间隔
|
| | | public bool guildChanged = false;
|
| | | //Type:0-无;1-成员加入;2-成员退出;3-收人设置修改;4-公告修改;5-徽章修改;6-盟主变更;7-成员职位变更;8-成员上线;9-成员离线;
|
| | | //公会数据变化,请求新的公会信息,如在打开公会列表时请求,其他功能根据自身情况请求
|
| | | public void UpdateGuildDataChangeMark(HA521_tagMCFamilyChange netPack)
|
| | | {
|
| | | guildChanged = true;
|
| | | if (Time.time - lastChangeMarkTime < 0.2f)
|
| | | {
|
| | | //小优化 如果有问题也可以去除
|
| | | return;
|
| | | }
|
| | | lastChangeMarkTime = Time.time;
|
| | | if ((netPack.Type == 1 || netPack.Type == 2) && UIManager.Instance.IsOpened<GuildBaseWin>())
|
| | | {
|
| | | RequestGuildData();
|
| | | }
|
| | | }
|
| | |
|
| | | public void RequestGuildData()
|
| | | {
|
| | | if (guildChanged)
|
| | | {
|
| | | guildChanged = false;
|
| | | var pack = new CA626_tagCMGetFamilyInfo();
|
| | | GameNetSystem.Instance.SendInfo(pack);
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void SendKickFairy(uint playerID)
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.ServerNow.Hour < 10)
|
| | | if (TimeUtility.GetCommServerNow(zoneID).Hour < 10)
|
| | | return;
|
| | |
|
| | | if (zhenbaogeCutState == 0)
|
| | |
| | | /// </summary> |
| | | public class GuildMemberCell : CellView |
| | | { |
| | | |
| | | |
| | | [SerializeField] AvatarCell avatarCell; |
| | | [SerializeField] OfficialTitleCell titleCell; |
| | | [SerializeField] Text lvText; |
| | |
| | | |
| | | avatarCell.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerID, playerInfo.ServerID); |
| | | }); |
| | | |
| | | contribText.text = playerInfo.ContribDay + "/" + playerInfo.ContribTotal; |
| | |
| | | showArrowImg.transform.localScale = new Vector3(1, -1, 1); |
| | | } |
| | | } |
| | | |
| | | |
| | | //例子 取整处理, 1.5天 显示1天; 最大7天特殊处理 |
| | | //x天 |
| | | //x时 |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.RequestGuildData(); |
| | | |
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo; |
| | | Display(); |
| | |
| | | |
| | | int guildID; |
| | | int leaderID; |
| | | int leaderServerID; |
| | | protected override void InitComponent() |
| | | { |
| | | opearteBtn.AddListener(() => |
| | |
| | | |
| | | leaderAvatar.AddListener(() => |
| | | { |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, leaderServerID); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | void Display() |
| | | { |
| | | var guildInfo = GuildManager.Instance.guildsDict[guildID]; |
| | | FairyData guildInfo = null; |
| | | if (GuildManager.Instance.guildsDict.ContainsKey(guildID)) |
| | | { |
| | | guildInfo = GuildManager.Instance.guildsDict[guildID]; |
| | | } |
| | | else |
| | | { |
| | | if (GuildManager.Instance.viewGuildsDict.ContainsKey(guildID)) |
| | | { |
| | | guildInfo = GuildManager.Instance.viewGuildsDict[guildID]; |
| | | } |
| | | } |
| | | if (guildInfo == null) return; |
| | | leaderID = guildInfo.LeaderID; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, (int)ViewPlayerType.viewGuildLeader); |
| | | leaderServerID = guildInfo.ServerID; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(leaderID, leaderServerID, (int)ViewPlayerType.viewGuildLeader); |
| | | |
| | | var config = FamilyConfig.Get(guildInfo.FamilyLV); |
| | | guildEmblem.Display(guildInfo.EmblemID, guildInfo.EmblemWord, 0.7f); |
| | |
| | | // 0-成员,1-精英,2-副盟主,3-盟主
|
| | | public int leaderID;
|
| | | public string leaderName;
|
| | | // // 精英
|
| | | public List<int> elitePlayerIDList = new List<int>();
|
| | | // // 副盟主
|
| | | public List<int> deputyLeaderPlayerIDList = new List<int>();
|
| | |
|
| | | //差异更新 需增删改 memberDic memberIDList deputyLeaderPlayerIDList
|
| | | public void OnRefreshGuildInfo(HA520_tagMCRoleFamilyInfo vNetData)
|
| | | {
|
| | | if (fairy == null)
|
| | |
| | | fairy.totalFightPower = vNetData.FightPowerEx * Constants.ExpPointValue + vNetData.FightPower;
|
| | | fairy.Broadcast = vNetData.Broadcast;
|
| | | fairy.LeaderID = (int)vNetData.LeaderID;
|
| | | fairy.MemberCount = vNetData.MemberCount;
|
| | |
|
| | | mine = null;
|
| | | fairy.lastChangeNameTick = (int)vNetData.Extra1;
|
| | |
|
| | | memberDic.Clear();
|
| | | memberIDList.Clear();
|
| | | deputyLeaderPlayerIDList.Clear();
|
| | |
|
| | | for (int i = 0; i < vNetData.MemberCount; i++)
|
| | | {
|
| | | FairyMember member = new FairyMember();
|
| | |
| | | OnRefreshFairyMine?.Invoke();
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | // 0-成员,1-精英,2-副盟主,3-盟主
|
| | |
|
| | | // if (member.FmLV == 1)
|
| | | // {
|
| | | // elitePlayerIDList.Add(member.PlayerID);
|
| | | // }
|
| | | if (member.FmLV == 2)
|
| | | if (deputyLeaderPlayerIDList.Contains(member.PlayerID) && member.FmLV != 2)
|
| | | {
|
| | | deputyLeaderPlayerIDList.Remove(member.PlayerID);
|
| | | }
|
| | | else if (member.FmLV == 2 && !deputyLeaderPlayerIDList.Contains(member.PlayerID))
|
| | | {
|
| | | // 对应的变更 和 退出需同步修改
|
| | | deputyLeaderPlayerIDList.Add(member.PlayerID);
|
| | | }
|
| | |
|
| | |
|
| | | if (member.FmLV == 3)
|
| | | {
|
| | | leaderID = (int)member.PlayerID;
|
| | | leaderID = member.PlayerID;
|
| | | leaderName = member.Name;
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | memberIDList.AddRange(memberDic.Keys);
|
| | | memberIDList.Sort(SortMember);
|
| | | if (mine.FmLV == 3 && mine.PlayerID != leaderID)
|
| | | {
|
| | | mine.FmLV = 0;
|
| | | }
|
| | | RefreshMemberIDList();
|
| | |
|
| | | if (OnRefreshFairyInfo != null) OnRefreshFairyInfo();
|
| | | }
|
| | |
|
| | |
|
| | | public void DeleteMember(HA524_tagSCFamilyMemDel netPack)
|
| | | {
|
| | | if (memberDic.ContainsKey((int)netPack.PlayerID))
|
| | | {
|
| | | memberDic.Remove((int)netPack.PlayerID);
|
| | | RefreshMemberIDList();
|
| | | }
|
| | | if (deputyLeaderPlayerIDList.Contains((int)netPack.PlayerID))
|
| | | {
|
| | | deputyLeaderPlayerIDList.Remove((int)netPack.PlayerID);
|
| | | }
|
| | |
|
| | | OnRefreshFairyInfo?.Invoke();
|
| | | }
|
| | |
|
| | | void RefreshMemberIDList()
|
| | | {
|
| | | memberIDList.Clear();
|
| | | memberIDList.AddRange(memberDic.Keys);
|
| | | memberIDList.Sort(SortMember);
|
| | | fairy.MemberCount = memberIDList.Count;
|
| | | }
|
| | |
|
| | | public FairyMember GetMember(int playerid)
|
| | |
| | | public long totalFightPower;
|
| | | public string Broadcast;
|
| | | public int LeaderID; //族长玩家ID
|
| | | public int LeaderServerID; //族长服务器ID
|
| | | public int MemberCount;
|
| | | public int lastChangeNameTick;
|
| | |
|
| | | //查找增加的字段
|
| | | public string LeaderName;
|
| | |
| | | public class FairyApply
|
| | | {
|
| | | public int PlayerID;
|
| | | public string Name; |
| | | public string Name;
|
| | | public int ReqTime; //申请时间戳
|
| | | public int LV; //等级
|
| | | public int Job; //职业
|
| | |
| | | public int Face; //基本脸型
|
| | | public int FacePic; //头像框
|
| | | public int TitleID; //称号
|
| | | public long FightPower; |
| | | public long FightPower;
|
| | | public int ServerID; //所属区服ID
|
| | | public int IsOnLine; //是否在线
|
| | | }
|
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | public class ServersSmallTipCell : CellView |
| | | { |
| | | [SerializeField] Text[] serversText; |
| | | |
| | | |
| | | |
| | | public void Display(int index) |
| | | { |
| | | for (int i = 0; i < serversText.Length; i++) |
| | | { |
| | | int listIndex = index + i; |
| | | if (listIndex >= ServersSmallTipWin.serverIDList.Count) |
| | | { |
| | | serversText[i].text = ""; |
| | | continue; |
| | | } |
| | | serversText[i].SetActive(true); |
| | | var serverID = ServersSmallTipWin.serverIDList[index + i]; |
| | | serversText[i].text = ServerListCenter.Instance.GetServerName(serverID); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/Guild/ServersSmallTipCell.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 36a723a4b576693468a90ba111d5b58c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | public class ServersSmallTipWin : UIBase |
| | | { |
| | | [SerializeField] RectTransform content; |
| | | [SerializeField] RectTransform arrow; |
| | | [SerializeField] ScrollerController serversScroller; |
| | | |
| | | public static List<int> serverIDList; |
| | | protected override void OnPreOpen() |
| | | { |
| | | serversScroller.OnRefreshCell += OnRefreshCell; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | serversScroller.OnRefreshCell -= OnRefreshCell; |
| | | } |
| | | |
| | | |
| | | protected override void NextFrameAfterOpen() |
| | | { |
| | | var worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | |
| | | |
| | | Vector2 screenAdjustedPos = CameraManager.uiCamera.WorldToScreenPoint(worldPos); |
| | | |
| | | var beforePos = screenAdjustedPos; |
| | | var beforeAdjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(beforePos); |
| | | |
| | | var rectWidth = content.rect.width * Screen.width / canvasScaler.referenceResolution.x; |
| | | screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectWidth * 0.5f, Screen.width - rectWidth * 0.5f); |
| | | screenAdjustedPos.y -= 40; |
| | | var adjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(screenAdjustedPos); |
| | | adjustedPos.z = 0; |
| | | content.position = adjustedPos; |
| | | |
| | | arrow.position = new Vector3(beforeAdjustedPos.x, arrow.position.y, 0); |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | serversScroller.Refresh(); |
| | | for (int i = 0; i < serverIDList.Count; i++) |
| | | { |
| | | if (i % 4 == 0) |
| | | { |
| | | serversScroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | serversScroller.Restart(); |
| | | } |
| | | |
| | | void OnRefreshCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<ServersSmallTipCell>(); |
| | | _cell.Display(cell.index); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/Guild/ServersSmallTipWin.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: d3c0b72418f3c5345ba779c8382e0eb0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// </summary> |
| | | public class HeroCallWin : UIBase |
| | | { |
| | | [SerializeField] TimingGiftCell timingGiftCell; |
| | | [SerializeField] Button ruleBtn; |
| | | [SerializeField] OwnItemCell ownItemCell; |
| | | [SerializeField] Button scoreBtn; |
| | |
| | | |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct += Refresh; |
| | | InvestModel.Instance.onInvestUpdate += OnInvestUpdate; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent; |
| | | timingGiftCell.InitUI(); |
| | | skipToggle.isOn = LocalSave.GetBool(HeroUIManager.skipKey + PlayerDatas.Instance.baseData.PlayerID, false); |
| | | Refresh(); |
| | | openPrivilegeTip.SetActive(!InvestModel.Instance.IsInvested(InvestModel.foreverCardType)); |
| | |
| | | { |
| | | HappyXBModel.Instance.RefreshXBTypeInfoAct -= Refresh; |
| | | InvestModel.Instance.onInvestUpdate -= OnInvestUpdate; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent; |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | | { |
| | | timingGiftCell.InitUI(); |
| | | } |
| | | |
| | | void OnInvestUpdate(int type) |
| | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HeroUIManager.Instance.washItemID, |
| | | HeroUIManager.Instance.GetTalentLockUseWashCount(hero), 2)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(4, HeroUIManager.Instance.washItemID, HeroUIManager.Instance.GetTalentLockUseWashCount(hero)); |
| | | return; |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < currentGiftCells.Length; i++) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(4,PackType.Item, HeroUIManager.Instance.washItemID, HeroUIManager.Instance.GetTalentLockUseWashCount(hero))) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(4, PackType.Item,HeroUIManager.Instance.washItemID, HeroUIManager.Instance.GetTalentLockUseWashCount(hero)); |
| | | } |
| | | HeroUIManager.Instance.SendWash(hero, 0); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | void ChangeLockEvent() |
| | | { |
| | | { |
| | | int useCount = HeroUIManager.Instance.GetTalentLockUseWashCount(hero); |
| | | var itemCount = PackManager.Instance.GetItemCountByID(PackType.Item, HeroUIManager.Instance.washItemID); |
| | | itemCountText.text = UIHelper.AppendColor(itemCount >= useCount ? TextColType.Green : TextColType.Red, |
| | |
| | | deleteTip.SetActive(false); |
| | | if (hero != null && hero.Quality == 1 && HeroUIManager.Instance.IsTheSameHeroFullStar(hero.heroId)) |
| | | { |
| | | |
| | | |
| | | deleteTip.SetActive(true); |
| | | } |
| | | } |
| | |
| | | }); |
| | | |
| | | HeroUIManager.Instance.lastFightPower = new KeyValuePair<string, long>(hero.itemHero.guid, hero.CalculateFightPower(false)); |
| | | // 如果正好消耗完,不触发固定概率的判定 |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(3, PackType.Item,itemID, needCount)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(3, PackType.Item,itemID, needCount); |
| | | } |
| | | return; |
| | | } |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(3, itemID, needCount); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | #region 突破功能 |
| | | |
| | | void DisplayTrainOrBreak(HeroInfo hero) |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using Jace.Operations; |
| | | using LitJson; |
| | | |
| | | using UnityEngine; |
| | |
| | | [SerializeField] Image costItemImg; |
| | | [SerializeField] Button rankUpBtn; |
| | | |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | rankUpBtn.AddListener(HorseRankUpgrade); |
| | |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | Display(); |
| | | } |
| | | |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent; |
| | |
| | | var curValue = HorseManager.Instance.attrDic[keys[i]]; |
| | | attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name; |
| | | attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], curValue, 2); |
| | | |
| | | nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], |
| | | |
| | | nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], |
| | | curValue + nextConfig.ClassAttrValueList[i] + nextConfig.PerLVAttrValueList[i], 2); |
| | | } |
| | | } |
| | |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt, 2)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(12, PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt); |
| | | return; |
| | | } |
| | | |
| | | var pack = new CB202_tagCSHorseClassUP(); |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(12, PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(12, PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt); |
| | | } |
| | | } |
| | | |
| | | void OnRefreshItemEvent(PackType type, int index, int itemID) |
| | |
| | | }); |
| | | lvupBtn.AddListener(HorseUpgrade); |
| | | lvupBtn.onPress.AddListener(HorseUpgrade); |
| | | quickUpToggle.onValueChanged.AddListener((bool value)=>{ OnToggle(value);}); |
| | | quickUpToggle.onValueChanged.AddListener((bool value) => { OnToggle(value); }); |
| | | rankUpBtn.AddListener(HorseRankUpgrade); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HorseManager.Instance.lvUPItemID, 1, 2)) |
| | | { |
| | | { |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(12, PackType.Item, HorseManager.Instance.lvUPItemID, isQuick ? GetQuickUseCnt() : 1); |
| | | return; |
| | | } |
| | | |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(12, PackType.Item, HorseManager.Instance.lvUPItemID, isQuick ? GetQuickUseCnt() : 1)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(12, PackType.Item, HorseManager.Instance.lvUPItemID, isQuick ? GetQuickUseCnt() : 1); |
| | | } |
| | | |
| | | var pack = new CB201_tagCSHorseLVUP(); |
| | |
| | | specialAttrText.text = GetSpecialAttr(); |
| | | |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | lvText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | lvText.text = Language.Get("Horse8", HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | processImg.fillAmount = HorseManager.Instance.exp / (float)config.LVUPItemCnt; |
| | | processText.text = HorseManager.Instance.exp + "/" + config.LVUPItemCnt; |
| | | |
| | |
| | | { |
| | | if (HorseManager.Instance.specialAttrDic.Count == 0) |
| | | return ""; |
| | | |
| | | |
| | | List<string> attrList = new List<string>(); |
| | | foreach(var attrID in HorseManager.Instance.specialAttrDic.Keys) |
| | | foreach (var attrID in HorseManager.Instance.specialAttrDic.Keys) |
| | | { |
| | | attrList.Add(UIHelper.AppendColor(TextColType.itemchuanqi, PlayerPropertyConfig.GetFullDescription(attrID, HorseManager.Instance.specialAttrDic[attrID]))); |
| | | } |
| | |
| | | void OnToggle(bool value) |
| | | { |
| | | LocalSave.SetBool("HorseQuickUp" + PlayerDatas.Instance.baseData.PlayerID, !quickUpToggle.isOn); |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | var state = HorseManager.Instance.GetHorseState(); |
| | | if (state == 0) |
| | | { |
| | | int useCnt = 1; |
| | | if (HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV && quickUpToggle.isOn) |
| | | { |
| | | useCnt = config.LVUPItemCnt - HorseManager.Instance.exp; |
| | | } |
| | | int useCnt = GetQuickUseCnt(); |
| | | costText.text = UIHelper.ShowUseItem(PackType.Item, HorseManager.Instance.lvUPItemID, useCnt); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | int GetQuickUseCnt() |
| | | { |
| | | int useCnt = 1; |
| | | if (HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV && quickUpToggle.isOn) |
| | | { |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | useCnt = config.LVUPItemCnt - HorseManager.Instance.exp; |
| | | } |
| | | return useCnt; |
| | | } |
| | | |
| | | |
| | | void PlayerDataRefresh(PlayerDataType type) |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | void OnRefreshItemEvent(PackType type, int index, int itemID) |
| | | { |
| | |
| | | autoBtn.SetActive(false); |
| | | goldRushItemBtn.SetActive(false); |
| | | } |
| | | |
| | | |
| | | foreach (var npc in funcNPCs) |
| | | { |
| | | var key = npc.heroSkinID; |
| | | if (!FuncOpen.Instance.IsFuncOpen(FuncNPCManager.Instance.funcNPCToFuncID[key])) |
| | | { |
| | | npc.SetActive(false); |
| | | } |
| | | else |
| | | { |
| | | npc.SetActive(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | void OnFiveSecondEvent() |
| | | { |
| | | var index = FuncNPCManager.Instance.GetRandomAffairNpcTalk(); |
| | | var talk = FuncNPCManager.Instance.GetAffairTalk(funcNPCs[index].heroSkinID); |
| | | var skinID = FuncNPCManager.Instance.GetRandomAffairNpcTalk(); |
| | | var talk = FuncNPCManager.Instance.GetAffairTalk(skinID); |
| | | var index = 0; |
| | | for (int i = 0; i < funcNPCs.Length; i++) |
| | | { |
| | | if (funcNPCs[i].heroSkinID == skinID) |
| | | { |
| | | index = i; |
| | | break; |
| | | } |
| | | } |
| | | if (talk != null) |
| | | { |
| | | talkTexts[index].text = Language.Get(talk); |
| | |
| | | //内政NPC |
| | | Dictionary<int, string[]> affairNpcTalkDic = new Dictionary<int, string[]>(); |
| | | public List<int> affairTalkIndexList = new List<int>(); |
| | | public Dictionary<int, int> funcNPCToFuncID = new Dictionary<int, int>(); |
| | | public float lastAffairTalkTime; |
| | | public int lastAffiarRandomIndex; |
| | | |
| | |
| | | affairNpcTalkDic.Add(npcID, talkList); |
| | | } |
| | | |
| | | for (int i = 0; i < affairNpcTalkDic.Count; i++) |
| | | { |
| | | affairTalkIndexList.Add(i); |
| | | } |
| | | |
| | | |
| | | json = JsonMapper.ToObject(config.Numerical2); |
| | | keys = json.Keys.ToList(); |
| | |
| | | guildTalkIndexList.Add(i); |
| | | } |
| | | |
| | | funcNPCToFuncID = ConfigParse.ParseIntDict(config.Numerical3); |
| | | } |
| | | |
| | | |
| | | void RefreshAffairTalkIndexList() |
| | | { |
| | | affairTalkIndexList.Clear(); |
| | | foreach (var key in affairNpcTalkDic.Keys) |
| | | { |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcNPCToFuncID[key])) |
| | | { |
| | | continue; |
| | | } |
| | | if (funcNPCToFuncID[key] == 54 && MinggeManager.Instance.isStartAuto) |
| | | { |
| | | //算命中不参与喊话 |
| | | continue; |
| | | } |
| | | affairTalkIndexList.Add(key); |
| | | } |
| | | } |
| | | |
| | | |
| | | //随机某个NPC对话,与上一次随机的NPC索引不重复 |
| | | //返回NPCID |
| | | public int GetRandomAffairNpcTalk() |
| | | { |
| | | RefreshAffairTalkIndexList(); |
| | | int index = Random.Range(0, affairTalkIndexList.Count); |
| | | if (index == lastAffiarRandomIndex) |
| | | { |
| | | index = (index + 1) % affairTalkIndexList.Count; |
| | | } |
| | | lastAffiarRandomIndex = index; |
| | | return index; |
| | | return affairTalkIndexList[index]; |
| | | } |
| | | |
| | | public int GetRandomGuildNpcTalk() |
| | |
| | | void OnOK() |
| | | { |
| | | CloseWindow(); |
| | | if (curUseCount == 0) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("UseItem1"); |
| | | return; |
| | | } |
| | | if (ItemLogicUtility.CheckItemCount(PackType.Item, itemID, curUseCount, 2)) |
| | | { |
| | | ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID)); |
| | | ItemLogicUtility.Instance.UseItem(PackManager.Instance.GetItemGUIDByID(itemID), (int)curUseCount); |
| | | } |
| | | } |
| | | } |
| | |
| | | UIManager.Instance.OpenWindow<StoreBaseWin>(1);
|
| | | }
|
| | | break;
|
| | | case 3:
|
| | | if (!TimingGiftManager.Instance.IsShowGiftIdListHasType(int.Parse(way.CustomValue)))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActivityNoOpen");
|
| | | return;
|
| | | }
|
| | | if (!UIManager.Instance.IsOpened<TimingGiftWin>())
|
| | | {
|
| | | UIManager.Instance.OpenWindow<TimingGiftWin>(int.Parse(way.CustomValue));
|
| | | }
|
| | | break;
|
| | | case 0:
|
| | | default:
|
| | | if (WindowSearchConfig.HasKey(way.WinJumpID))
|
| | |
| | |
|
| | | private void Confirm()
|
| | | {
|
| | | CloseWindow();
|
| | | if (!(StageManager.Instance.currentStage == StageName.Login))
|
| | | {
|
| | | GameNetSystem.Instance.LoginOut();
|
| | | }
|
| | |
|
| | | CloseWindow();
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return; |
| | | } |
| | | |
| | | if (GameNetSystem.Instance.netState == GameNetSystem.NetState.NerverConnect) |
| | | if (GameNetSystem.Instance.netState == GameNetSystem.NetState.NerverConnect || |
| | | GameNetSystem.Instance.netState == GameNetSystem.NetState.DisConnected) |
| | | { |
| | | switch (VersionConfig.Get().versionAuthority) |
| | | { |
| | |
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | |
|
| | |
| | | {
|
| | | reason = 0;
|
| | | CloseWindow();
|
| | | switch (VersionConfig.Get().versionAuthority)
|
| | | if (!(StageManager.Instance.currentStage == StageName.Login))
|
| | | {
|
| | | case VersionAuthority.InterTest:
|
| | | GameNotice.OpenGameNotice();
|
| | | break;
|
| | | case VersionAuthority.Release:
|
| | | if (!VersionConfig.Get().isBanShu)
|
| | | {
|
| | | if (!LoginManager.Instance.sdkLogined)
|
| | | {
|
| | | SDKUtils.Instance.FreePlatformLogin();
|
| | | }
|
| | | }
|
| | | break;
|
| | | GameNetSystem.Instance.LoginOut();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | { |
| | | get |
| | | { |
| | | int value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoFight_Cost, 0); |
| | | return Math.Min(Math.Max(value, 1), maxCost); |
| | | string value = QuickSetting.Instance.GetQuickSetting(QuickSettingType.AutoFight_Cost, 0); |
| | | // value 是16进制转数字 |
| | | int result = Convert.ToInt32(string.IsNullOrEmpty(value) ? "1" : value, 16); // 16进制转int |
| | | return Math.Min(Math.Max(result, 1), maxCost); |
| | | } |
| | | set |
| | | { |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Cost, value); |
| | | //数字value 转16进制 |
| | | string hexValue = Convert.ToString(value, 16); |
| | | QuickSetting.Instance.SetQuickSetting(QuickSettingType.AutoFight_Cost, hexValue, 0); |
| | | } |
| | | } |
| | | |
| | |
| | | [SerializeField] Button osMainLevelBtn; |
| | | [SerializeField] Button osHeroCallBtn; |
| | | [SerializeField] Button osGalaBtn; |
| | | [SerializeField] TimingGiftCell timingGiftCell; |
| | | |
| | | //坐骑 |
| | | [SerializeField] Image horseBGImg; |
| | |
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent; |
| | | ChatManager.Instance.OnUpdateTalkEvent += OnUpdateTalkEvent; |
| | | UIManager.Instance.OnOpenWindow += OnOpenWindow; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent; |
| | | TryPlayAutoFightBoss(); |
| | | Display(); |
| | | DisplayFirstChargeBtn(); |
| | | DisplayOSActivity(); |
| | | |
| | | timingGiftCell.InitUI(); |
| | | // var battleWin = UIManager.Instance.OpenWindow<BattleWin>(); |
| | | // battleWin.SetBattleField(BattleManager.Instance.storyBattleField); |
| | | |
| | |
| | | TimeMgr.Instance.OnDayEvent -= OnDayEvent; |
| | | ChatManager.Instance.OnUpdateTalkEvent -= OnUpdateTalkEvent; |
| | | UIManager.Instance.OnOpenWindow -= OnOpenWindow; |
| | | TimingGiftManager.Instance.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent; |
| | | // 关闭的时候把战斗界面也给关了 虽然是在外面开的 |
| | | UIManager.Instance.CloseWindow<BattleWin>(); |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | | { |
| | | timingGiftCell.InitUI(); |
| | | } |
| | | |
| | | private void OnAutoAttackEvent() |
| | |
| | | { |
| | | DisplayDailySpecialsBtn(); |
| | | } |
| | | else if (funcId == (int)FuncOpenEnum.TimingGift) |
| | | { |
| | | timingGiftCell.InitUI(); |
| | | } |
| | | } |
| | | |
| | | private void OnUpdateFirstChargeInfo() |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null || string.IsNullOrEmpty(m_OutputText)) |
| | | { |
| | | return 0f; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(Vector2.zero); |
| | | return cachedTextGeneratorForLayout.GetPreferredWidth(m_OutputText, settings) / pixelsPerUnit; |
| | | |
| | | float width = 0f; |
| | | try |
| | | { |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(m_OutputText, settings) / pixelsPerUnit; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed: {ex.Message}"); |
| | | width = 0f; |
| | | } |
| | | return width; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null || string.IsNullOrEmpty(m_OutputText)) |
| | | { |
| | | return 0f; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(new Vector2(rectTransform.rect.size.x, 0.0f)); |
| | | float _height = cachedTextGeneratorForLayout.GetPreferredHeight(m_OutputText, settings) / pixelsPerUnit; |
| | | return _height; |
| | | |
| | | float height = 0f; |
| | | try |
| | | { |
| | | height = cachedTextGeneratorForLayout.GetPreferredHeight(m_OutputText, settings) / pixelsPerUnit; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredHeight failed: {ex.Message}"); |
| | | height = 0f; |
| | | } |
| | | return height; |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | |
| | | private Dictionary<int, Match> matchDics = new Dictionary<int, Match>(); |
| | | |
| | | // 字符宽度缓存,避免重复计算相同字符 |
| | | private Dictionary<string, float> charWidthCache = new Dictionary<string, float>(); |
| | | |
| | | private bool IsModifySize(int _index,out int _size) |
| | | { |
| | | _size = 0; |
| | |
| | | { |
| | | font = FontUtility.preferred; |
| | | } |
| | | |
| | | // 添加 null 检查 |
| | | if (font == null || rectTransform == null || cachedTextGeneratorForLayout == null) |
| | | { |
| | | Debug.LogWarning("SetFitterSize: font, rectTransform or cachedTextGeneratorForLayout is null"); |
| | | return; |
| | | } |
| | | |
| | | var settings = GetGenerationSettings(Vector2.zero); |
| | | |
| | | float cache = 0; |
| | |
| | | float ratio = GetResolutionRatio(); |
| | | |
| | | matchDics.Clear(); |
| | | charWidthCache.Clear(); |
| | | |
| | | foreach (Match match in ImgAnalysis.Unity_Img_Regex.Matches(fitterText)) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(match.Value, settings) * ratio; |
| | | cache = GetCharWidthCached(match.Value, settings, ratio); |
| | | |
| | | if (width + cache > (rectTransform.rect.width - 5)) |
| | | { |
| | | CacluHrefAndImgIndex(Mathf.Max(0, i - 1)); |
| | |
| | | else |
| | | { |
| | | var _size = 0; |
| | | var _cacheFontSize = fontSize; |
| | | // 不再修改 fontSize,使用临时 TextGenerator 计算不同字号的宽度 |
| | | if (_modifySize && IsModifySize(i, out _size)) |
| | | { |
| | | fontSize = _size; |
| | | settings = GetGenerationSettings(Vector2.zero); |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(fitterText[i].ToString(), settings) * ratio; |
| | | fontSize = _cacheFontSize; |
| | | settings = GetGenerationSettings(Vector2.zero); |
| | | cache = GetCharWidthWithCustomSize(fitterText[i], _size, ratio); |
| | | } |
| | | else |
| | | { |
| | | cache = cachedTextGeneratorForLayout.GetPreferredWidth(fitterText[i].ToString(), settings) * ratio; |
| | | cache = GetCharWidthCached(fitterText[i].ToString(), settings, ratio); |
| | | } |
| | | |
| | | if (width + cache > (rectTransform.rect.width - 5)) |
| | | { |
| | | CacluHrefAndImgIndex(Mathf.Max(0, i - 1)); |
| | |
| | | m_OutputText = textBuilder.ToString(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取字符宽度(带缓存) |
| | | /// </summary> |
| | | private float GetCharWidthCached(string charStr, TextGenerationSettings settings, float ratio) |
| | | { |
| | | string cacheKey = $"{fontSize}_{charStr}"; |
| | | |
| | | if (charWidthCache.ContainsKey(cacheKey)) |
| | | { |
| | | return charWidthCache[cacheKey]; |
| | | } |
| | | |
| | | float width = 0; |
| | | try |
| | | { |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(charStr, settings) * ratio; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed for '{charStr}': {ex.Message}"); |
| | | width = 0; |
| | | } |
| | | |
| | | charWidthCache[cacheKey] = width; |
| | | return width; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 使用自定义字号计算字符宽度(不修改原始 Text 组件的 fontSize) |
| | | /// </summary> |
| | | private float GetCharWidthWithCustomSize(char c, int customFontSize, float ratio) |
| | | { |
| | | string charStr = c.ToString(); |
| | | string cacheKey = $"{customFontSize}_{charStr}"; |
| | | |
| | | if (charWidthCache.ContainsKey(cacheKey)) |
| | | { |
| | | return charWidthCache[cacheKey]; |
| | | } |
| | | |
| | | float width = 0; |
| | | try |
| | | { |
| | | // 创建临时的 TextGenerationSettings,使用自定义字号 |
| | | TextGenerationSettings tempSettings = GetGenerationSettings(Vector2.zero); |
| | | tempSettings.fontSize = customFontSize; |
| | | |
| | | width = cachedTextGeneratorForLayout.GetPreferredWidth(charStr, tempSettings) * ratio; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogError($"GetPreferredWidth failed for '{charStr}' with fontSize {customFontSize}: {ex.Message}"); |
| | | width = 0; |
| | | } |
| | | |
| | | charWidthCache[cacheKey] = width; |
| | | return width; |
| | | } |
| | | |
| | | private void CacluHrefAndImgIndex(int index) |
| | | { |
| | | for (int i = 0; i < m_ImgList.Count; i++) |
| | |
| | | var diffRate = littleRateValue + (bigRateValue - littleRateValue) / (float)(bigValue - littleValue) * (value - littleValue); |
| | | rateList.Add((int)diffRate); |
| | | } |
| | | |
| | | |
| | | return rateList; |
| | | } |
| | | |
| | |
| | | { |
| | | if (isStart) |
| | | { |
| | | |
| | | |
| | | bool canStart = false; |
| | | for (int i = 0; i < autoSetList.Count; i++) |
| | | { |
| | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, tyItemID, useAutoCostCnt, 2)) |
| | | { |
| | | isStartAuto = false; |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(6, PackType.Item, tyItemID, useAutoCostCnt); |
| | | return; |
| | | } |
| | | UIManager.Instance.CloseWindow<MinggeAutoSetWin>(); |
| | | TimingGiftManager.Instance.TryAddWhenExactConsumption(6, PackType.Item, tyItemID, useAutoCostCnt); |
| | | |
| | | } |
| | | |
| | | |
| | | isStartAuto = isStart; |
| | | if (isStartAuto) |
| | | { |
| | |
| | | |
| | | return deFightAttrOK && fightAttrOK; |
| | | } |
| | | |
| | | |
| | | bool IsFightPowerOK(ItemModel mgEquip, MinggeAutoSet autoSet) |
| | | { |
| | | long showFightPower = FightPowerManager.Instance.GetFightPowerMinggeChange(mgEquip, autoSet.presetID); |
| | |
| | | { |
| | | isStartAuto = false; |
| | | SysNotifyMgr.Instance.ShowTip("MinggeAuto1"); |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(6, PackType.Item, tyItemID, useAutoCostCnt); |
| | | return; |
| | | } |
| | | |
| | | TimingGiftManager.Instance.TryAddWhenExactConsumption(6, PackType.Item, tyItemID, useAutoCostCnt); |
| | | |
| | | autoTYTime = Time.time; |
| | | SendTY(useAutoCostCnt); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void OnMSEvent() |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | { |
| | | MinggeManager.Instance.OnMinggeInfoUpdate -= Display; |
| | | } |
| | | |
| | | |
| | | public void Display() |
| | | { |
| | | var config = ItemConfig.Get(MinggeManager.Instance.qlItemID); |
| | |
| | | } |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, MinggeManager.Instance.qlItemID, useCnt, 2)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(6, PackType.Item, MinggeManager.Instance.qlItemID, useCnt); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | qlEffect.Play(); |
| | | // 如果正好消耗完,不触发固定概率的判定 |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(6, PackType.Item, MinggeManager.Instance.qlItemID, useCnt)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(6, PackType.Item, MinggeManager.Instance.qlItemID, useCnt); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | autoBtn.AddListener(AutoTY); |
| | | funPresetBtn.AddListener(()=> |
| | | funPresetBtn.AddListener(() => |
| | | { |
| | | FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Story); |
| | | }); |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | |
| | | PackManager.Instance.RefreshItemEvent += RefreshItemEvent; |
| | | PackManager.Instance.DeleteItemEvent += DeleteDropItem; |
| | | MinggeManager.Instance.OnMinggeInfoUpdate += OnMinggeInfoUpdate; |
| | |
| | | |
| | | funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow()); |
| | | ChangeAutoEvent(); |
| | | |
| | | |
| | | } |
| | | void RefreshItemEvent(PackType type, int index, int itemID) |
| | | { |
| | |
| | | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, MinggeManager.Instance.tyItemID, 1, 2)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWhenInsufficient(6, PackType.Item, MinggeManager.Instance.tyItemID, 1); |
| | | return; |
| | | } |
| | | |
| | | // 如果正好消耗完,不触发固定概率的判定 |
| | | if (!TimingGiftManager.Instance.TryAddWhenExactConsumption(6, PackType.Item, MinggeManager.Instance.tyItemID, 1)) |
| | | { |
| | | TimingGiftManager.Instance.TryAddWithFixedProbabilityWhenSufficient(6, MinggeManager.Instance.tyItemID, 1); |
| | | } |
| | | |
| | | if (MinggeManager.Instance.isStartAuto) |
| | | { |
| | | MinggeManager.Instance.StartAuto(false); |
| | |
| | | return viewPlayerData; |
| | | } |
| | | |
| | | // 向服务端请求其他玩家数据 |
| | | public void ViewPlayerDetail(int playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewBattlePreSetType = (int)BattlePreSetType.Story) |
| | | // 向服务端请求其他玩家数据 serverID发0默认本服玩家 |
| | | public void ViewPlayerDetail(int playerId, int serverID, int viewType = (int)ViewPlayerType.viewPlayerData, int viewBattlePreSetType = (int)BattlePreSetType.Story) |
| | | { |
| | | // 自己不能查看自己的信息 |
| | | if (playerId == PlayerDatas.Instance.baseData.PlayerID) |
| | |
| | | |
| | | viewPlayerType = viewType; |
| | | viewPreSetType = viewBattlePreSetType; |
| | | ViewRoleParticulars(playerId); |
| | | ViewRoleParticulars(playerId, serverID); |
| | | } |
| | | |
| | | // 向服务端请求玩家数据 |
| | | void ViewRoleParticulars(int playerID) |
| | | void ViewRoleParticulars(int playerID, int serverID) |
| | | { |
| | | if (playerID <= 0) |
| | | return; |
| | |
| | | |
| | | CA212_tagCMViewPlayerInfo pak = new CA212_tagCMViewPlayerInfo(); |
| | | pak.PlayerID = (uint)playerID; |
| | | pak.ServerID = (uint)serverID; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | } |
| | | public void OnRevRoleEquip(HA705_tagSCQueryPlayerCacheResult package) |
| | |
| | | viewPlayerData.FamilyID = (int)package.FamilyID; |
| | | viewPlayerData.FamilyName = UIHelper.ServerStringTrim(package.FamilyName); |
| | | viewPlayerData.FamilyEmblemID = (int)package.FamilyEmblemID; |
| | | viewPlayerData.FamilyDataServerID = (int)package.FamilyDataServerID; |
| | | viewPlayerData.FamilyEmblemWord = UIHelper.ServerStringTrim(package.FamilyEmblemWord); |
| | | |
| | | |
| | |
| | | { |
| | | if (viewPlayerType == (int)ViewPlayerType.viewPlayerData) |
| | | { |
| | | if (!UIManager.Instance.IsOpened<OtherPlayerDetailWin>()) |
| | | if (UIManager.Instance.IsOpened<OtherPlayerDetailWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<OtherPlayerDetailWin>(viewPreSetType); |
| | | UIManager.Instance.CloseWindow<OtherPlayerDetailWin>(); |
| | | } |
| | | UIManager.Instance.OpenWindow<OtherPlayerDetailWin>(viewPreSetType); |
| | | } |
| | | |
| | | OnRevPackage?.Invoke(viewPlayerType, playerID); |
| | |
| | | public int ServerID; |
| | | public long FightPower; |
| | | public int FamilyID; |
| | | public int FamilyDataServerID; //公会数据所在服务器ID,A619查看公会用 |
| | | public string FamilyName; |
| | | public int FamilyEmblemID; |
| | | public string FamilyEmblemWord; |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList += OnRefreshFairyList; |
| | | GuildManager.Instance.OnUpdateViewFamilyInfo += OnUpdateViewFamilyInfo; |
| | | funcPresetID = OtherPlayerDetailManager.Instance.GetFuncPresetID(manager.viewPlayer, functionOrder, (int)FuncPresetType.Global); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | GuildManager.Instance.OnRefreshFairyList -= OnRefreshFairyList; |
| | | GuildManager.Instance.OnUpdateViewFamilyInfo -= OnUpdateViewFamilyInfo; |
| | | } |
| | | |
| | | private void OnRefreshFairyList() |
| | | private void OnUpdateViewFamilyInfo() |
| | | { |
| | | if (viewPlayerData == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (!GuildManager.Instance.guildsDict.ContainsKey(viewPlayerData.FamilyID)) |
| | | if (!GuildManager.Instance.viewGuildsDict.ContainsKey(viewPlayerData.FamilyID)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | SysNotifyMgr.Instance.ShowTip("GuildTip01"); |
| | | return; |
| | | } |
| | | GuildManager.Instance.SendFindGuildNoDecrypt(viewPlayerData.FamilyID.ToString()); |
| | | GuildManager.Instance.SendViewGuild(viewPlayerData.FamilyID, viewPlayerData.FamilyDataServerID); |
| | | } |
| | | |
| | | private void OnClickMM() |
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID, (int)ViewPlayerType.viewPlayerData);
|
| | | AvatarHelper.TryViewOtherPlayerInfo(avatarModel.playerID);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public static class AvatarHelper
|
| | | {
|
| | | public static void TryViewOtherPlayerInfo(int _playerId, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
|
| | | //serverID发0默认本服玩家
|
| | | public static void TryViewOtherPlayerInfo(int playerId, int serverID = 0, int viewType = (int)ViewPlayerType.viewPlayerData, int viewPlayerLineupType = (int)BattlePreSetType.Story)
|
| | | {
|
| | | if (_playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | if (playerId == PlayerDatas.Instance.PlayerId || UIManager.Instance.IsOpened<OtherPlayerDetailWin>())
|
| | | return;
|
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(_playerId, viewType, viewPlayerLineupType);
|
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, serverID, viewType, viewPlayerLineupType);
|
| | | }
|
| | |
|
| | | public static AvatarModel GetAvatarModel(int playerId, int face, int facePic, int job = 0)
|
| | | {
|
| | | bool isMyself = playerId == PlayerDatas.Instance.PlayerId;
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 12fd399fb4ee8f145bbe14cb76a38d03 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | public class SettingDataManager : GameSystemManager<SettingDataManager> |
| | | { |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | } |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | settingDataDict.Clear(); |
| | | } |
| | | |
| | | public event Action OnUpdateSettingDataEvent; |
| | | Dictionary<int, string> settingDataDict = new Dictionary<int, string>(); |
| | | |
| | | public bool TryGetSettingData(int keyNum, out string setData) |
| | | { |
| | | return settingDataDict.TryGetValue(keyNum, out setData); |
| | | } |
| | | |
| | | public Dictionary<int, string> GetSettingData() |
| | | { |
| | | return settingDataDict; |
| | | } |
| | | |
| | | public void UpdateSettingData(HA131_tagSCSettingDataInfo pack) |
| | | { |
| | | if (pack == null || pack.SettingDataList.IsNullOrEmpty()) |
| | | return; |
| | | for (int i = 0; i < pack.SettingDataList.Length; i++) |
| | | { |
| | | var info = pack.SettingDataList[i]; |
| | | settingDataDict[info.KeyNum] = info.SetData; |
| | | } |
| | | OnUpdateSettingDataEvent?.Invoke(); |
| | | } |
| | | |
| | | public void ClearSettingData(int keyNum) |
| | | { |
| | | SendSettingData(keyNum, string.Empty); |
| | | } |
| | | |
| | | public void SendSettingData(SettingDataKeyNum keyNum, string setData) |
| | | { |
| | | SendSettingData((int)keyNum, setData); |
| | | } |
| | | |
| | | public void SendSettingData(int keyNum, string setData) |
| | | { |
| | | // 检查数据长度是否超过byte最大值 |
| | | if (setData.Length > byte.MaxValue) |
| | | { |
| | | Debug.LogError($"设置数据长度({setData.Length})超过byte最大值({byte.MaxValue})"); |
| | | return; |
| | | } |
| | | CA131_tagCSSettingData pack = new CA131_tagCSSettingData(); |
| | | pack.KeyNum = (byte)keyNum; |
| | | pack.SetData = setData; |
| | | pack.DataLen = (byte)setData.Length; |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | } |
| | | public enum SettingDataKeyNum |
| | | { |
| | | TimingGiftType = 1, |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/SettingDataManager.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 11efe5307ce944149977d11036bcd76a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class TimingGiftAwardCell : MonoBehaviour |
| | | { |
| | | [SerializeField] ItemCell itemCell; |
| | | TimingGiftManager manager { get { return TimingGiftManager.Instance; } } |
| | | public void Display(int index, int[][] gainItemList) |
| | | { |
| | | if (gainItemList.IsNullOrEmpty() || index < 0 || index >= gainItemList.Length) |
| | | return; |
| | | int itemId = gainItemList[index][0]; |
| | | int count = gainItemList[index][1]; |
| | | itemCell.Init(new ItemCellModel(itemId, false, count)); |
| | | itemCell.button.SetListener(() => { ItemTipUtility.Show(itemId); }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftAwardCell.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 9282d2427d5b8f349a85e3e53c6e92e6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class TimingGiftCell : MonoBehaviour |
| | | { |
| | | private void Awake() |
| | | { |
| | | //如果有需要按钮点击逻辑,在外层创建,此处不处理点击逻辑 |
| | | LoadPrefab(); |
| | | button.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<TimingGiftWin>(type); |
| | | }); |
| | | } |
| | | |
| | | ButtonEx m_button; |
| | | public ButtonEx button |
| | | { |
| | | get |
| | | { |
| | | if (m_button == null) |
| | | { |
| | | m_button = this.GetComponent<ButtonEx>("TimingGiftCell"); |
| | | } |
| | | return m_button; |
| | | } |
| | | } |
| | | |
| | | TextEx m_Time; |
| | | private TextEx time |
| | | { |
| | | get |
| | | { |
| | | if (m_Time == null) |
| | | { |
| | | m_Time = this.GetComponent<TextEx>("TimingGiftCell/bgImage/timeImage/timeText"); |
| | | } |
| | | return m_Time; |
| | | } |
| | | } |
| | | |
| | | public int type; |
| | | GameObject prefab; |
| | | TimingGiftManager manager { get { return TimingGiftManager.Instance; } } |
| | | void OnEnable() |
| | | { |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent; |
| | | manager.OnShowGiftIdListAddEvent += OnShowGiftIdListAddEvent; |
| | | manager.OnRemoveExpiredEvent += OnRemoveExpiredEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | } |
| | | |
| | | void OnDisable() |
| | | { |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent; |
| | | manager.OnShowGiftIdListAddEvent -= OnShowGiftIdListAddEvent; |
| | | manager.OnRemoveExpiredEvent -= OnRemoveExpiredEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | } |
| | | |
| | | private void OnFuncStateChangeEvent(int obj) |
| | | { |
| | | if (obj == (int)FuncOpenEnum.TimingGift) |
| | | { |
| | | Display(); |
| | | } |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | private void OnShowGiftIdListAddEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | private void OnRemoveExpiredEvent() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | public void Display() |
| | | { |
| | | //配0时是主界面入口 |
| | | if (type == 0) |
| | | { |
| | | var list = manager.GetCurrectTimingGiftIdList(); |
| | | bool isNullOrEmpty = list.IsNullOrEmpty(); |
| | | this.SetActive(!isNullOrEmpty); |
| | | if (isNullOrEmpty) |
| | | return; |
| | | int id = list[0]; |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(id, out var config)) |
| | | return; |
| | | RefreshTime(config.GiftType); |
| | | return; |
| | | } |
| | | RefreshTime(type); |
| | | } |
| | | |
| | | private void RefreshTime(int type) |
| | | { |
| | | bool isShow = manager.IsShowGiftIdListHasType(type); |
| | | this.SetActive(isShow); |
| | | if (isShow) |
| | | { |
| | | int times = manager.GetRemainingSecondsByType(type); |
| | | time.text = times <= 0 ? Language.Get("TimingGift04") : TimeUtility.SecondsToHMS(times); |
| | | time.colorType = times <= 0 ? TextColType.Red : TextColType.LightGreen; |
| | | } |
| | | } |
| | | |
| | | protected void LoadPrefab() |
| | | { |
| | | if (prefab != null) |
| | | return; |
| | | var tmp = transform.Find("TimingGiftCell"); |
| | | |
| | | if (tmp != null) |
| | | { |
| | | prefab = tmp.gameObject; |
| | | return; |
| | | } |
| | | prefab = UIUtility.CreateWidget("TimingGiftCell", "TimingGiftCell"); |
| | | |
| | | prefab.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | prefab.transform.SetAsFirstSibling(); |
| | | |
| | | } |
| | | |
| | | public void InitUI() |
| | | { |
| | | LoadPrefab(); //存在被卸载的可能,重新加载 |
| | | Display(); |
| | | } |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftCell.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 92affed6278f93648a3e7bff0e3f1eb8 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class TimingGiftCtgIdCell : MonoBehaviour |
| | | { |
| | | [SerializeField] TextEx moneyText; |
| | | [SerializeField] ButtonEx moneyButton; |
| | | [SerializeField] ImageEx tabIcon; |
| | | TimingGiftManager manager { get { return TimingGiftManager.Instance; } } |
| | | public void Display(int index, int[] ctgIds) |
| | | { |
| | | if (ctgIds.IsNullOrEmpty() || index < 0 || index >= ctgIds.Length) |
| | | return; |
| | | int ctgId = ctgIds[index]; |
| | | if (!RechargeManager.Instance.TryGetOrderInfo(ctgId, out var orderInfoConfig)) |
| | | return; |
| | | moneyText.text = Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale); |
| | | |
| | | bool isChoose = manager.selectCtgIdIndex == index; |
| | | tabIcon.SetSprite(isChoose ? "TimingGiftTab2_Select" : "TimingGiftTab2_UnSelect"); |
| | | moneyButton.SetListener(() => |
| | | { |
| | | manager.selectCtgId = ctgId; |
| | | if (!CTGConfig.HasKey(manager.selectCtgId)) |
| | | return; |
| | | CTGConfig ctgConfig = CTGConfig.Get(manager.selectCtgId); |
| | | manager.selectGainItemList = ctgConfig.GainItemList; |
| | | manager.selectCtgIdIndex = index; |
| | | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftCtgIdCell.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 755ed8982ee993644bfabedf48f2b80a |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | public class TimingGiftManager : GameSystemManager<TimingGiftManager> |
| | | { |
| | | |
| | | private int m_selectTabIndex; |
| | | public int selectTabIndex |
| | | { |
| | | get { return m_selectTabIndex; } |
| | | set |
| | | { |
| | | if (m_selectTabIndex == value) |
| | | return; |
| | | m_selectTabIndex = value; |
| | | OnSelectTabIndexChangeEvent?.Invoke(); |
| | | } |
| | | } |
| | | public int selectTabGiftId; |
| | | public event Action OnSelectTabIndexChangeEvent; |
| | | |
| | | private int m_selectCtgIdIndex; |
| | | public int selectCtgIdIndex |
| | | { |
| | | get { return m_selectCtgIdIndex; } |
| | | set |
| | | { |
| | | if (m_selectCtgIdIndex == value) |
| | | return; |
| | | m_selectCtgIdIndex = value; |
| | | OnSelectCtgIdIndexChangeEvent?.Invoke(); |
| | | } |
| | | } |
| | | public int selectCtgId; |
| | | |
| | | public int[] selectCtgIds; |
| | | public int[][] selectGainItemList; |
| | | public event Action OnSelectCtgIdIndexChangeEvent; |
| | | |
| | | public bool isLogShow = true; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitializeEventOnRelogin; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | } |
| | | |
| | | |
| | | |
| | | private void OnBeforePlayerDataInitializeEventOnRelogin() |
| | | { |
| | | showGiftIdList.Clear(); |
| | | lastTriggerTimeDict.Clear(); |
| | | |
| | | } |
| | | |
| | | private void OnPlayerLoginOk() |
| | | { |
| | | LoadData(); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | RemoveExpired(); |
| | | } |
| | | |
| | | public Color32 GetColor32(int[] colorArr) |
| | | { |
| | | if (colorArr == null || colorArr.Length < 3) |
| | | return Color.white; |
| | | return new Color32() |
| | | { |
| | | r = (byte)(colorArr.Length > 0 ? colorArr[0] : 0), |
| | | g = (byte)(colorArr.Length > 1 ? colorArr[1] : 0), |
| | | b = (byte)(colorArr.Length > 2 ? colorArr[2] : 0), |
| | | a = (byte)(colorArr.Length > 3 ? colorArr[3] : 255), |
| | | }; |
| | | } |
| | | |
| | | public static bool TryGetTimingGiftTypeConfig(int giftType, out TimingGiftTypeConfig config) |
| | | { |
| | | config = null; |
| | | if (!TimingGiftTypeConfig.HasKey(giftType)) |
| | | return false; |
| | | config = TimingGiftTypeConfig.Get(giftType); |
| | | return true; |
| | | } |
| | | |
| | | public bool IsBuy(int ctgId) |
| | | { |
| | | if (!CTGConfig.HasKey(ctgId)) |
| | | return false; |
| | | CTGConfig ctgConfig = CTGConfig.Get(ctgId); |
| | | bool hasRechargeCount = RechargeManager.Instance.TryGetRechargeCount(ctgId, out RechargeCount _rechargeCount); |
| | | bool isBuy = hasRechargeCount && _rechargeCount.todayCount >= ctgConfig.DailyBuyCount; |
| | | return isBuy; |
| | | } |
| | | |
| | | public bool IsListHasIndex(int index, List<int> list) |
| | | { |
| | | return list != null && index >= 0 && index < list.Count; |
| | | } |
| | | |
| | | public int GetListValue(int index, List<int> list) |
| | | { |
| | | return IsListHasIndex(index, list) ? list[index] : 0; |
| | | } |
| | | |
| | | public bool IsArrHasIndex(int index, int[] arr) |
| | | { |
| | | return arr != null && index >= 0 && index < arr.Length; |
| | | } |
| | | |
| | | public int GetArrValue(int index, int[] arr) |
| | | { |
| | | return IsArrHasIndex(index, arr) ? arr[index] : 0; |
| | | } |
| | | |
| | | public void OpenTimingGiftWin(int type) |
| | | { |
| | | if (!UIManager.Instance.IsOpened<TimingGiftWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<TimingGiftWin>(type); |
| | | } |
| | | } |
| | | |
| | | List<int> showGiftIdList = new List<int>(); |
| | | |
| | | public event Action OnShowGiftIdListAddEvent; |
| | | |
| | | public bool IsShowGiftIdListHasType(int type) |
| | | { |
| | | if (showGiftIdList.IsNullOrEmpty()) |
| | | return false; |
| | | for (int i = 0; i < showGiftIdList.Count; i++) |
| | | { |
| | | int id = showGiftIdList[i]; |
| | | if (TimingGiftConfig.TryGetTimingGiftConfig(id, out TimingGiftConfig config) && config.GiftType == type) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public List<int> GetCurrectTimingGiftIdList(bool isSort = false) |
| | | { |
| | | if (isSort) |
| | | { |
| | | // 按剩余时间少的排序靠前 |
| | | showGiftIdList.Sort((a, b) => |
| | | { |
| | | int remainingSecondsA = GetRemainingSeconds(a); |
| | | int remainingSecondsB = GetRemainingSeconds(b); |
| | | return remainingSecondsA.CompareTo(remainingSecondsB); |
| | | }); |
| | | } |
| | | return showGiftIdList; |
| | | } |
| | | |
| | | public void TryAdd(int type) |
| | | { |
| | | |
| | | if (NewBieCenter.Instance.inGuiding) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] TryPop:触发Return,正在引导中"); |
| | | } |
| | | #endif |
| | | return; |
| | | } |
| | | |
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.TimingGift)) |
| | | { |
| | | |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] TryPop:触发Return,时机礼包功能未开启"); |
| | | } |
| | | #endif |
| | | return; |
| | | } |
| | | |
| | | if (!IsTodayUnlimited(type)) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | int lastTriggerTime = lastTriggerTimeDict[type]; |
| | | DateTime lastTime = TimeUtility.GetTime((uint)lastTriggerTime); |
| | | Debug.Log($"[TimingGift] TryPop:触发Return,今天已弹出过{type}类型的礼包,该类型上次弹出时间为{lastTime:yyyy-MM-dd HH:mm:ss}"); |
| | | } |
| | | #endif |
| | | return; |
| | | } |
| | | |
| | | if (!TimingGiftConfig.TryGetTypeToGiftIdList(type, out List<int> giftIdList)) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] TryPop:触发Return,表格中没有找到{type}类型的礼包ID"); |
| | | } |
| | | #endif |
| | | return; |
| | | } |
| | | |
| | | bool isChange = false; |
| | | for (int i = 0; i < giftIdList.Count; i++) |
| | | { |
| | | int id = giftIdList[i]; |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(id, out TimingGiftConfig config)) |
| | | continue; |
| | | if (showGiftIdList.Contains(id)) |
| | | continue; |
| | | isChange = true; |
| | | showGiftIdList.Add(id); |
| | | lastTriggerTimeDict[id] = TimeUtility.AllSeconds; |
| | | } |
| | | |
| | | if (isChange) |
| | | { |
| | | SaveData(); |
| | | OpenTimingGiftWin(type); |
| | | OnShowGiftIdListAddEvent?.Invoke(); |
| | | } |
| | | |
| | | } |
| | | |
| | | public event Action OnRemoveExpiredEvent; |
| | | public void RemoveExpired() |
| | | { |
| | | if (showGiftIdList.IsNullOrEmpty()) |
| | | return; |
| | | bool isChange = false; |
| | | |
| | | // 使用倒序遍历,避免移除元素时索引错位 |
| | | for (int i = showGiftIdList.Count - 1; i >= 0; i--) |
| | | { |
| | | int id = showGiftIdList[i]; |
| | | // 已经过期的移除 |
| | | if (IsExpired(id)) |
| | | { |
| | | isChange = true; |
| | | showGiftIdList.RemoveAt(i); |
| | | } |
| | | } |
| | | |
| | | if (isChange) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] RemoveExpired:触发移除过期礼包,当前有时效的giftID列表为[{string.Join(", ", showGiftIdList)}]"); |
| | | } |
| | | #endif |
| | | OnRemoveExpiredEvent?.Invoke(); |
| | | } |
| | | } |
| | | |
| | | //触发类型 上次触发时间 |
| | | Dictionary<int, int> lastTriggerTimeDict = new Dictionary<int, int>(); |
| | | public bool TryGetLastTriggerTime(int type, out int lastTriggerTime) |
| | | { |
| | | return lastTriggerTimeDict.TryGetValue(type, out lastTriggerTime); |
| | | } |
| | | |
| | | public bool IsExpired(int id) |
| | | { |
| | | return GetRemainingSeconds(id) <= 0; |
| | | } |
| | | |
| | | public int GetRemainingSecondsByType(int type) |
| | | { |
| | | if (!TryGetLastTriggerTime(type, out int lastTriggerTime)) |
| | | return 0; |
| | | if (!TryGetTimingGiftTypeConfig(type, out TimingGiftTypeConfig typeConfig)) |
| | | return 0; |
| | | |
| | | // 计算剩余秒数 |
| | | DateTime lastTime = TimeUtility.GetTime((uint)lastTriggerTime); |
| | | DateTime nowTime = TimeUtility.ServerNow; |
| | | double elapsedSeconds = (nowTime - lastTime).TotalSeconds; |
| | | int remainingSeconds = (int)(typeConfig.Duration - elapsedSeconds); |
| | | |
| | | return remainingSeconds; |
| | | } |
| | | |
| | | public int GetRemainingSeconds(int id) |
| | | { |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(id, out TimingGiftConfig config)) |
| | | return 0; |
| | | int type = config.GiftType; |
| | | return GetRemainingSecondsByType(type); |
| | | } |
| | | |
| | | // 判断指定type的礼包今日是否不限弹出 |
| | | // true:今日不限弹出 false:今日已弹出过 |
| | | public bool IsTodayUnlimited(int type) |
| | | { |
| | | // 没有触发记录,说明还没弹出过 |
| | | if (!TryGetLastTriggerTime(type, out int lastTriggerTime)) |
| | | return true; |
| | | |
| | | // 如果上次触发时间在今天0点之前,说明今天还没弹出过 |
| | | int todayStartTick = TimeUtility.GetTodayStartTick(); |
| | | return lastTriggerTime < todayStartTick; |
| | | } |
| | | |
| | | private bool IsTriggle(int type) |
| | | { |
| | | if (!TryGetTimingGiftTypeConfig(type, out TimingGiftTypeConfig config)) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] IsTriggle:未找到{type}类型的TriggleChangeRate配置"); |
| | | } |
| | | #endif |
| | | return false; |
| | | } |
| | | |
| | | int rangeNum = UnityEngine.Random.Range(0, 100); |
| | | bool res = rangeNum < config.TriggleChangeRate; |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] IsTriggle:判定固定概率,结果={res}, type={type}, rangeNum={rangeNum}, TriggleChangeRate={config.TriggleChangeRate}"); |
| | | } |
| | | #endif |
| | | return res; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #region 礼包弹出条件 |
| | | |
| | | /// <summary> |
| | | /// 使用完广告次数时弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenAllAdsUsed(int type, int adId) |
| | | { |
| | | if (!ADAwardConfig.HasKey(adId)) |
| | | return false; |
| | | ADAwardConfig config = ADAwardConfig.Get(adId); |
| | | int maxCount = config.ADCntMax; |
| | | int haveCount = AdsManager.Instance.GetADCntByADID(adId) + 1; |
| | | TryAddWhenAllAdsUsed(type, haveCount, maxCount); |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 使用完广告次数时弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenAllAdsUsed(int type, int haveCount, int maxCount) |
| | | { |
| | | if (maxCount == haveCount) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 数量不足时必弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenInsufficient(int type, PackType packType, int itemId, long needCount) |
| | | { |
| | | var haveCount = PackManager.Instance.GetItemCountByID(packType, itemId); |
| | | return TryAddWhenInsufficient(type, haveCount, needCount); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 数量不足时必弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenInsufficient(int type, long haveCount, long needCount) |
| | | { |
| | | // 需要0个时必弹 |
| | | if (needCount <= 0) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | |
| | | bool isEnough = haveCount >= needCount; |
| | | |
| | | // 不足时必弹 |
| | | if (!isEnough) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 数量正好消耗完时必弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenExactConsumption(int type, PackType packType, int itemId, long needCount) |
| | | { |
| | | var haveCount = PackManager.Instance.GetItemCountByID(packType, itemId); |
| | | return TryAddWhenExactConsumption(type, haveCount, needCount); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 数量正好消耗完时必弹出 |
| | | /// </summary> |
| | | public bool TryAddWhenExactConsumption(int type, long haveCount, long needCount) |
| | | { |
| | | // 需要0个时必弹 |
| | | if (needCount <= 0) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | |
| | | //正好消耗完x时必弹 |
| | | if (haveCount - needCount == 0) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | /// <summary> |
| | | /// 充足时固定概率弹出 |
| | | /// </summary> |
| | | public bool TryAddWithFixedProbabilityWhenSufficient(int type, PackType packType, int itemId, long needCount) |
| | | { |
| | | var haveCount = PackManager.Instance.GetItemCountByID(packType, itemId); |
| | | return TryAddWithFixedProbabilityWhenSufficient(type, haveCount, needCount); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 充足时固定概率弹出 |
| | | /// </summary> |
| | | public bool TryAddWithFixedProbabilityWhenSufficient(int type, long haveCount, long needCount) |
| | | { |
| | | bool isEnough = haveCount >= needCount; |
| | | if (!isEnough) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | bool isTriggle = IsTriggle(type); |
| | | if (isTriggle) |
| | | { |
| | | TryAdd(type); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | #region 数据保存 |
| | | private void LoadData() |
| | | { |
| | | lastTriggerTimeDict.Clear(); |
| | | |
| | | if (!SettingDataManager.Instance.TryGetSettingData((int)SettingDataKeyNum.TimingGiftType, out string data)) |
| | | return; |
| | | // 使用 LocalSave 读取 JSON 字符串 |
| | | if (string.IsNullOrEmpty(data) || data == "{}") |
| | | return; |
| | | Dictionary<int, int> loadDict = ConfigParse.ParseIntDict(data); |
| | | if (loadDict == null) |
| | | return; |
| | | |
| | | lastTriggerTimeDict = loadDict; |
| | | InitCurrectTimingGiftIdList(new List<int>(loadDict.Keys)); |
| | | |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] LoadData:当前有时效的giftID列表为: [{string.Join(", ", showGiftIdList)}]\n当前触发时间字典内容:\n{string.Join("\n", lastTriggerTimeDict.Select(kv => $" 类型{kv.Key}: {TimeUtility.GetTime((uint)kv.Value):yyyy-MM-dd HH:mm:ss}"))}"); |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | private void SaveData() |
| | | { |
| | | string jsonStr = JsonMapper.ToJson(lastTriggerTimeDict); |
| | | SettingDataManager.Instance.SendSettingData(SettingDataKeyNum.TimingGiftType, jsonStr); |
| | | #if UNITY_EDITOR |
| | | if (isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] SaveData:当前有时效的giftID列表为: [{string.Join(", ", showGiftIdList)}]\n保存的触发时间字典内容:\n{string.Join("\n", lastTriggerTimeDict.Select(kv => $" 类型{kv.Key}: {TimeUtility.GetTime((uint)kv.Value):yyyy-MM-dd HH:mm:ss}"))}"); |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public void InitCurrectTimingGiftIdList(List<int> list) |
| | | { |
| | | if (list == null) |
| | | return; |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | int type = list[i]; |
| | | if (!TimingGiftConfig.TryGetTypeToGiftIdList(type, out List<int> giftIdList)) |
| | | continue; |
| | | for (int j = 0; j < giftIdList.Count; j++) |
| | | { |
| | | // 表中没有的不处理 |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(type, out TimingGiftConfig config)) |
| | | continue; |
| | | // 已经过期的不处理 |
| | | if (IsExpired(type)) |
| | | continue; |
| | | // 重复的不处理 |
| | | if (showGiftIdList.Contains(type)) |
| | | continue; |
| | | showGiftIdList.Add(type); |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftManager.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: b10601b615e27b1409dbc408badbb1c1 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class TimingGiftTabCell : MonoBehaviour |
| | | { |
| | | [SerializeField] Color selectColor; |
| | | [SerializeField] Color unSelectColor; |
| | | [SerializeField] TextEx tabNameText; |
| | | [SerializeField] ButtonEx tabButton; |
| | | [SerializeField] ImageEx tabIcon; |
| | | [SerializeField] Transform line; |
| | | TimingGiftManager manager { get { return TimingGiftManager.Instance; } } |
| | | public void Display(int index) |
| | | { |
| | | var currectTimingGiftIdList = manager.GetCurrectTimingGiftIdList(); |
| | | if (currectTimingGiftIdList == null || index < 0 || index >= currectTimingGiftIdList.Count) |
| | | return; |
| | | int id = currectTimingGiftIdList[index]; |
| | | if (!TimingGiftConfig.HasKey(id)) |
| | | return; |
| | | line.SetActive(currectTimingGiftIdList.Count > 1 && index < currectTimingGiftIdList.Count - 1); |
| | | TimingGiftConfig config = TimingGiftConfig.Get(id); |
| | | tabNameText.text = config.GiftName; |
| | | bool isChoose = manager.selectTabIndex == index; |
| | | tabIcon.SetSprite(isChoose ? "TimingGiftTab1_Select" : "TimingGiftTab1_UnSelect"); |
| | | tabIcon.SetNativeSize(); |
| | | tabNameText.color = isChoose ? selectColor : unSelectColor; |
| | | tabButton.SetListener(() => |
| | | { |
| | | manager.selectTabGiftId = id; |
| | | manager.selectTabIndex = index; |
| | | }); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftTabCell.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 584a05a7f813e494990d0e3e0e6d3906 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | |
| | | public class TimingGiftWin : UIBase |
| | | { |
| | | [SerializeField] ScrollerController tabScroller; |
| | | [SerializeField] ScrollerController awardScroller; |
| | | |
| | | [SerializeField] TimingGiftCtgIdCell[] ctgIdCells; |
| | | |
| | | [SerializeField] TextEx timeText; |
| | | [SerializeField] ImageEx bgImage; |
| | | [SerializeField] ImageEx IconImage; |
| | | [SerializeField] GradientText giftText; //"礼包" |
| | | [SerializeField] OutlineEx giftTextOutline; |
| | | [SerializeField] GradientText giftNameText; |
| | | [SerializeField] TextEx rateText; |
| | | [SerializeField] GradientText rateNameText; //充值返利 |
| | | [SerializeField] ButtonEx buyButton; |
| | | [SerializeField] ImageEx buyImage; |
| | | [SerializeField] TextEx buyText; |
| | | [SerializeField] ButtonEx leftButton; |
| | | [SerializeField] ButtonEx rightButton; |
| | | [SerializeField] ButtonEx closeButton; |
| | | TimingGiftManager manager { get { return TimingGiftManager.Instance; } } |
| | | |
| | | int type; |
| | | List<int> currectTimingGiftIdList; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | buyButton.SetListener(() => |
| | | { |
| | | RechargeManager.Instance.CTG(manager.selectCtgId); |
| | | }); |
| | | leftButton.SetListener(() => UpdateTabSelection(-1)); |
| | | rightButton.SetListener(() => UpdateTabSelection(1)); |
| | | closeButton.SetListener(CloseWindow); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | type = functionOrder; |
| | | #if UNITY_EDITOR |
| | | if (manager.isLogShow) |
| | | { |
| | | Debug.Log($"[TimingGift] 打开界面,被{type}类型触发"); |
| | | } |
| | | #endif |
| | | tabScroller.OnRefreshCell += OnRefreshTabCell; |
| | | awardScroller.OnRefreshCell += OnRefreshAwardCell; |
| | | manager.OnSelectTabIndexChangeEvent += OnSelectTabIndexChangeEvent; |
| | | manager.OnSelectCtgIdIndexChangeEvent += OnSelectCtgIdIndexChangeEvent; |
| | | manager.OnRemoveExpiredEvent += OnRemoveExpiredEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent += OnRechargeCountEvent; |
| | | CreateAll(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | tabScroller.OnRefreshCell -= OnRefreshTabCell; |
| | | awardScroller.OnRefreshCell -= OnRefreshAwardCell; |
| | | manager.OnSelectTabIndexChangeEvent -= OnSelectTabIndexChangeEvent; |
| | | manager.OnSelectCtgIdIndexChangeEvent -= OnSelectCtgIdIndexChangeEvent; |
| | | manager.OnRemoveExpiredEvent -= OnRemoveExpiredEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | RechargeManager.Instance.rechargeCountEvent -= OnRechargeCountEvent; |
| | | } |
| | | |
| | | private void OnRechargeCountEvent(int obj) |
| | | { |
| | | DisplayGift(); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | RefreshTime(); |
| | | } |
| | | |
| | | private void OnRemoveExpiredEvent() |
| | | { |
| | | var list = manager.GetCurrectTimingGiftIdList(); |
| | | if (list.IsNullOrEmpty()) |
| | | { |
| | | DelayCloseWindow().Forget(); |
| | | return; |
| | | } |
| | | CreateAll(); |
| | | } |
| | | |
| | | private void OnSelectTabIndexChangeEvent() |
| | | { |
| | | |
| | | InitializeSelectedCtgConfig(); |
| | | tabScroller.m_Scorller.RefreshActiveCellViews(); |
| | | DisplayCtgIdCells(); |
| | | CreateAwardScroller(); |
| | | DisplayGift(); |
| | | } |
| | | |
| | | private void OnSelectCtgIdIndexChangeEvent() |
| | | { |
| | | DisplayCtgIdCells(); |
| | | CreateAwardScroller(); |
| | | DisplayGift(); |
| | | } |
| | | |
| | | private void InitializeSelectedCtgConfig() |
| | | { |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(manager.selectTabGiftId, out TimingGiftConfig config)) |
| | | return; |
| | | manager.selectCtgIds = config.CTGIDs; |
| | | int index = 0; |
| | | manager.selectCtgId = manager.GetArrValue(index, config.CTGIDs); |
| | | |
| | | if (!CTGConfig.HasKey(manager.selectCtgId)) |
| | | return; |
| | | CTGConfig ctgConfig = CTGConfig.Get(manager.selectCtgId); |
| | | manager.selectGainItemList = ctgConfig.GainItemList; |
| | | manager.selectCtgIdIndex = index; |
| | | } |
| | | |
| | | private void UpdateTabSelection(int direction) |
| | | { |
| | | int maxIndex = currectTimingGiftIdList.Count - 1; |
| | | int tempIndex = manager.selectTabIndex + direction; |
| | | int realIndex = tempIndex < 0 ? maxIndex : (tempIndex > maxIndex ? 0 : tempIndex); |
| | | |
| | | manager.selectTabGiftId = manager.GetListValue(realIndex, currectTimingGiftIdList); |
| | | manager.selectTabIndex = realIndex; |
| | | tabScroller.JumpIndex(manager.selectTabIndex); |
| | | |
| | | InitializeSelectedCtgConfig(); |
| | | } |
| | | |
| | | private void RefreshTime() |
| | | { |
| | | int times = manager.GetRemainingSeconds(manager.selectTabGiftId); |
| | | timeText.text = times <= 0 ? Language.Get("TimingGift04") : Language.Get("TimingGift03", TimeUtility.SecondsToHMS(times)); |
| | | timeText.colorType = times <= 0 ? TextColType.Red : TextColType.LightGreen; |
| | | } |
| | | |
| | | private int FindTypeIndex(int type) |
| | | { |
| | | for (int i = 0; i < currectTimingGiftIdList.Count; i++) |
| | | { |
| | | int id = currectTimingGiftIdList[i]; |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(id, out TimingGiftConfig config)) |
| | | continue; |
| | | if (config.GiftType == type) |
| | | return i; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | private void CreateAll() |
| | | { |
| | | currectTimingGiftIdList = manager.GetCurrectTimingGiftIdList(isSort: true); |
| | | |
| | | int index = FindTypeIndex(type); |
| | | manager.selectTabGiftId = manager.GetListValue(index, currectTimingGiftIdList); |
| | | manager.selectTabIndex = index; |
| | | InitializeSelectedCtgConfig(); |
| | | |
| | | CreateTabScroller(); |
| | | tabScroller.JumpIndex(manager.selectTabIndex); |
| | | |
| | | DisplayCtgIdCells(); |
| | | CreateAwardScroller(); |
| | | DisplayGift(); |
| | | } |
| | | |
| | | private void CreateTabScroller() |
| | | { |
| | | if (currectTimingGiftIdList.Count < 2) |
| | | { |
| | | tabScroller.SetActive(false); |
| | | return; |
| | | } |
| | | tabScroller.SetActive(true); |
| | | |
| | | tabScroller.Refresh(); |
| | | for (int i = 0; i < currectTimingGiftIdList.Count; i++) |
| | | { |
| | | tabScroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | tabScroller.Restart(); |
| | | } |
| | | |
| | | private void CreateAwardScroller() |
| | | { |
| | | awardScroller.Refresh(); |
| | | if (!manager.selectGainItemList.IsNullOrEmpty()) |
| | | { |
| | | for (int i = 0; i < manager.selectGainItemList.Length; i++) |
| | | { |
| | | awardScroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | awardScroller.Restart(); |
| | | } |
| | | public void DisplayCtgIdCells() |
| | | { |
| | | if (manager.selectCtgIds.IsNullOrEmpty()) |
| | | { |
| | | for (int i = 0; i < ctgIdCells.Length; i++) |
| | | { |
| | | ctgIdCells[i].SetActive(false); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < ctgIdCells.Length; i++) |
| | | { |
| | | if (i < manager.selectCtgIds.Length) |
| | | { |
| | | ctgIdCells[i].SetActive(true); |
| | | ctgIdCells[i].Display(i, manager.selectCtgIds); |
| | | } |
| | | else |
| | | { |
| | | ctgIdCells[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | private void DisplayGift() |
| | | { |
| | | if (!TimingGiftConfig.TryGetTimingGiftConfig(manager.selectTabGiftId, out TimingGiftConfig config)) |
| | | return; |
| | | if (!CTGConfig.HasKey(manager.selectCtgId)) |
| | | return; |
| | | CTGConfig ctgConfig = CTGConfig.Get(manager.selectCtgId); |
| | | if (!RechargeManager.Instance.TryGetOrderInfo(manager.selectCtgId, out var orderInfoConfig)) |
| | | return; |
| | | bool isShowSwitch = currectTimingGiftIdList.Count > 1; |
| | | leftButton.SetActive(isShowSwitch); |
| | | rightButton.SetActive(isShowSwitch); |
| | | |
| | | bgImage.SetSprite($"TimingGiftBg_{manager.selectTabGiftId}"); |
| | | bgImage.SetNativeSize(); |
| | | IconImage.SetSprite($"TimingGiftIcon_{manager.selectTabGiftId}"); |
| | | giftNameText.text = config.GiftName; |
| | | rateText.text = Language.Get("TimingGift02", ctgConfig.Percentage); |
| | | rateNameText.text = Language.Get("TimingGift05"); |
| | | giftText.text = Language.Get("TimingGift01"); |
| | | giftText.SetVerticalGradient(manager.GetColor32(config.TopColor), manager.GetColor32(config.BottomColor)); |
| | | giftTextOutline.OutlineColor = manager.GetColor32(config.OutlineColor); |
| | | bool isBuy = manager.IsBuy(manager.selectCtgId); |
| | | buyText.text = !isBuy ? Language.Get("PayMoneyNum", orderInfoConfig.PayRMBNumOnSale) : Language.Get("L1133"); |
| | | buyImage.SetSprite(isBuy ? "TimingGiftBuy" : "TimingGiftNoBuy"); |
| | | buyImage.raycastTarget = !isBuy; |
| | | RefreshTime(); |
| | | } |
| | | |
| | | private void OnRefreshTabCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<TimingGiftTabCell>(); |
| | | _cell?.Display(cell.index); |
| | | } |
| | | private void OnRefreshAwardCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<TimingGiftAwardCell>(); |
| | | _cell?.Display(cell.index, manager.selectGainItemList); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/TimingGift/TimingGiftWin.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 6f6ea5c4c1921414dbc448656d693512 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | { |
| | | case BattleConst.ArenaBattleField: |
| | | int playerId = (int)ArenaManager.Instance.atkPlayerId; |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, (int)ViewPlayerType.viewArenaBattleEnemyHero, (int)BattlePreSetType.Arena); |
| | | OtherPlayerDetailManager.Instance.ViewPlayerDetail(playerId, 0, (int)ViewPlayerType.viewArenaBattleEnemyHero, (int)BattlePreSetType.Arena); |
| | | break; |
| | | } |
| | | return; |
| | |
| | | }); |
| | | } |
| | | |
| | | public void TryOpenNPCDetailWin(uint mapID, uint funcLineID, uint npcID) |
| | | { |
| | | if (TryGetNPCAttr(mapID, funcLineID, npcID, out ViewNPCAttr attr)) |
| | | { |
| | | OpenNPCDetailWin(attr); |
| | | } |
| | | } |
| | | |
| | | public ViewNPCAttr viewNPCAttr; |
| | | private void OpenNPCDetailWin(ViewNPCAttr viewNPCAttr) |
| | | public void OpenNPCDetailWin(ViewNPCAttr viewNPCAttr) |
| | | { |
| | | this.viewNPCAttr = viewNPCAttr; |
| | | if (!UIManager.Instance.IsOpened<OtherNPCDetailWin>()) |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class TowerBaseWin : OneLevelWin |
| | | { |
| | | [SerializeField] Transform WarlordPavilionWinTop; |
| | | protected override void OpenSubUIByTabIndex() |
| | | { |
| | | WarlordPavilionWinTop.SetActive(functionOrder == 0); |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | currentSubUI = UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/WarlordPavilion/TowerBaseWin.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 8849ec4f80ae3604db56ee7a9a1be0b6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | |
| | | public class WarlordPavilionManager : GameSystemManager<WarlordPavilionManager> |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | public bool TryGetNPCConfig(int layerNum, int levelNum, out NPCConfig npcConfig) |
| | | public bool TryGetLineupConfig(int layerNum, int levelNum, out NPCLineupConfig npcLineupConfig) |
| | | { |
| | | npcConfig = null; |
| | | npcLineupConfig = null; |
| | | if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(layerNum, levelNum, out var config)) |
| | | return false; |
| | | int npcID = config.NPCID; |
| | | if (!NPCConfig.HasKey(npcID)) |
| | | int lineupID = config.LineupIDList[0]; |
| | | if (!NPCLineupConfig.HasKey(lineupID)) |
| | | return false; |
| | | npcConfig = NPCConfig.Get(npcID); |
| | | npcLineupConfig = NPCLineupConfig.Get(lineupID); |
| | | return true; |
| | | } |
| | | |
| | | public int viewNPCID = 0; |
| | | // 获取该阵容指定位置的npcID, posNum范围1-6 |
| | | public bool TryGetNPCIDInLineupByPosNum(NPCLineupConfig config, int posNum, out int npcID) |
| | | { |
| | | npcID = 0; |
| | | if (config == null || posNum < 1 || posNum > 6) |
| | | return false; |
| | | |
| | | npcID = posNum switch |
| | | { |
| | | 1 => config.PosNPCID1, |
| | | 2 => config.PosNPCID2, |
| | | 3 => config.PosNPCID3, |
| | | 4 => config.PosNPCID4, |
| | | 5 => config.PosNPCID5, |
| | | 6 => config.PosNPCID6, |
| | | _ => 0 |
| | | }; |
| | | return NPCConfig.HasKey(npcID); |
| | | } |
| | | |
| | | |
| | | public bool IsTodayNoFight() |
| | | { |
| | |
| | | |
| | | if (!IsAutoFuncOpen(false)) |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.OpenWindow<TowerBaseWin>(); |
| | | return; |
| | | } |
| | | |
| | |
| | | bool hasNext = FBDJGLevelConfig.TryGetNextLevel(layerNum, levelNum, out int nextLayerNum, out int nextLevelNum); |
| | | if (!hasNext) |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.OpenWindow<TowerBaseWin>(); |
| | | return; |
| | | } |
| | | |
| | |
| | | bool isAutoPresetOn = IsAutoPresetOn(); |
| | | if (hasBonusToSelect && !isAutoPresetOn) |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.OpenWindow<TowerBaseWin>(); |
| | | UIManager.Instance.OpenWindow<WarlordPavilionSelectBonusWin>(); |
| | | return; |
| | | } |
| | | |
| | | if (!isAutoNext) |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionWin>(); |
| | | UIManager.Instance.OpenWindow<TowerBaseWin>(); |
| | | return; |
| | | } |
| | | |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | public class WarlordPavilionNPCItem : MonoBehaviour |
| | | { |
| | | public int posNum; |
| | | [SerializeField] UIHeroController uiHeroController; |
| | | [SerializeField] Button button; |
| | | [SerializeField] TextEx nameText; |
| | | [SerializeField] TextEx numText; |
| | | WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } } |
| | | |
| | | public void Display(NPCLineupConfig npcLineupConfig, float modelSize, int funcLineID, FBDJGLevelConfig config) |
| | | { |
| | | numText.text = posNum.ToString(); |
| | | bool hasHero = manager.TryGetNPCIDInLineupByPosNum(npcLineupConfig, posNum, out int npcID); |
| | | |
| | | uiHeroController.SetActive(hasHero); |
| | | nameText.SetActive(hasHero); |
| | | uiHeroController.SetActive(hasHero); |
| | | |
| | | if (!NPCConfig.HasKey(npcID)) |
| | | return; |
| | | NPCConfig npcConfig = NPCConfig.Get(npcID); |
| | | int heroID = npcConfig.RelatedHeroID; |
| | | if (!HeroConfig.HasKey(heroID)) |
| | | return; |
| | | HeroConfig heroConfig = HeroConfig.Get(heroID); |
| | | |
| | | uiHeroController.Create(npcConfig.SkinID, modelSize); |
| | | |
| | | Color color = UIHelper.GetUIColorByFunc(heroConfig.Quality); |
| | | string name = UIHelper.AppendColor(color, heroConfig.Name); |
| | | nameText.text = config.NPCLV == 0 ? name : Language.Get("WarlordPavilion34", name, config.NPCLV); |
| | | numText.text = posNum.ToString(); |
| | | button.SetListener(() => |
| | | { |
| | | if (!hasHero) |
| | | return; |
| | | if (ViewNPCManager.Instance.TryGetNPCAttr((uint)manager.DataMapID, (uint)funcLineID, (uint)npcID, out var npcAttr)) |
| | | { |
| | | ViewNPCManager.Instance.OpenNPCDetailWin(npcAttr); |
| | | return; |
| | | } |
| | | ViewNPCManager.Instance.SendViewNPCAttr((uint)manager.DataMapID, (uint)funcLineID, (uint)npcID); |
| | | manager.viewNPCID = npcID; |
| | | }); |
| | | } |
| | | } |
copy from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta
copy to Main/System/WarlordPavilion/WarlordPavilionNPCItem.cs.meta
| File was copied from Main/Core/NetworkPackage/DTCFile/ServerPack/HA5_Family/DTCA521_tagMCFamilyChange.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 95872d70a4fcdaf47a7089e954db72fb |
| | | guid: 89a6702338a7e464baff37bb3720cad9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | |
| | | { |
| | | [SerializeField] float modelSize; |
| | | [SerializeField] TextEx txtCurrentLevel; //当前关卡 |
| | | [SerializeField] TextEx txtBossName; |
| | | [SerializeField] UIHeroController uiHeroController; |
| | | [SerializeField] WarlordPavilionNPCItem[] heros; |
| | | [SerializeField] List<SkillWordCell> skillWords; |
| | | [SerializeField] ItemCell[] firstAwards; |
| | | [SerializeField] ImageEx[] firstAwardMasks; |
| | |
| | | [SerializeField] TextEx txtMax; |
| | | [SerializeField] ButtonEx btnRank; |
| | | [SerializeField] ButtonEx btnAward; |
| | | [SerializeField] ButtonEx btnBossInfo; |
| | | [SerializeField] ButtonEx btnFormation; //布阵 |
| | | [SerializeField] ButtonEx btnBonusPreset; //加成预设 |
| | | [SerializeField] TextEx txtBonusPreset; //加成预设 |
| | |
| | | WarlordPavilionManager manager { get { return WarlordPavilionManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | btnBossInfo.SetListener(() => |
| | | { |
| | | if (npcConfig == null) |
| | | return; |
| | | uint mapID = (uint)manager.DataMapID; |
| | | uint funcLineID = (uint)manager.GetLineID(showLayerNum, showLevelNum); |
| | | uint npcID = (uint)npcConfig.NPCID; |
| | | if (ViewNPCManager.Instance.TryGetNPCAttr(mapID, funcLineID, npcID, out var npcAttr) && npcAttr != null && npcAttr.AttrDict != null) |
| | | { |
| | | AttributeManager.Instance.OpenTotalAttributeWin(npcAttr.AttrDict); |
| | | return; |
| | | } |
| | | ViewNPCManager.Instance.SendViewNPCAttr(mapID, funcLineID, npcID); |
| | | }); |
| | | btnRank.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<WarlordPavilionRankWin>(); |
| | |
| | | { |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | manager.OnUpdateDingjungeInfoEvent += OnUpdateDingjungeInfo; |
| | | ViewNPCManager.Instance.OnUpdateViewNPCAttrRet += OnUpdateViewNPCAttrRet; |
| | | Display(); |
| | | } |
| | | |
| | |
| | | { |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | manager.OnUpdateDingjungeInfoEvent -= OnUpdateDingjungeInfo; |
| | | ViewNPCManager.Instance.OnUpdateViewNPCAttrRet -= OnUpdateViewNPCAttrRet; |
| | | } |
| | | |
| | | private void OnUpdateViewNPCAttrRet(uint mapID, uint funcLineID) |
| | | { |
| | | if (mapID != (uint)manager.DataMapID) |
| | | return; |
| | | ViewNPCManager.Instance.TryOpenNPCDetailWin(mapID, funcLineID, (uint)manager.viewNPCID); |
| | | } |
| | | |
| | | private void OnUpdateDingjungeInfo(List<int> indexs) |
| | |
| | | |
| | | int showLayerNum; |
| | | int showLevelNum; |
| | | int showFuncLineID; |
| | | FBDJGLevelConfig config; |
| | | NPCConfig npcConfig; |
| | | private void Display() |
| | | { |
| | | uIEffectPlayer.Stop(); |
| | |
| | | return; |
| | | if (!FBDJGLevelConfig.TryGetFBDJGLevelConfig(showLayerNum, showLevelNum, out config)) |
| | | return; |
| | | if (!manager.TryGetNPCConfig(showLayerNum, showLevelNum, out npcConfig)) |
| | | return; |
| | | |
| | | showFuncLineID = manager.GetLineID(showLayerNum, showLevelNum); |
| | | txtCurrentLevel.text = Language.Get("WarlordPavilion22", showLayerNum, showLevelNum); |
| | | txtBossName.text = npcConfig.NPCName; |
| | | uiHeroController.Create(npcConfig.SkinID, modelSize); |
| | | |
| | | DisplayHeros(config); |
| | | DisplaySkillWordsList(config.SkillIDExList); |
| | | DisplayItemCell(firstAwards, config.PassAwardList); |
| | | manager.DisplayItemCell(challengeAwards, config.AwardList); |
| | |
| | | } |
| | | funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow()); |
| | | } |
| | | |
| | | private void DisplayHeros(FBDJGLevelConfig config) |
| | | { |
| | | if (!manager.TryGetLineupConfig(config.LayerNum, config.LevelNum, out NPCLineupConfig npcLineupConfig)) |
| | | { |
| | | for (int i = 0; i < heros.Length; i++) |
| | | { |
| | | var hero = heros[i]; |
| | | hero.SetActive(false); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < heros.Length; i++) |
| | | { |
| | | var hero = heros[i]; |
| | | hero.Display(npcLineupConfig, modelSize, showFuncLineID, config); |
| | | } |
| | | } |
| | | |
| | | private void DisplayButtons() |
| | | { |
| | | bool isPass = manager.IsPass(); |
| | |
| | | Mingge = 54, //命格 |
| | | WarlordPavilion = 55, //定军阁 |
| | | FuncPreset = 56, //流派预设 |
| | | TimingGift = 57, //时机礼包 |
| | | } |
| | | |
| | | |
| | |
| | |
|
| | | public void BugReportSys( string _content)
|
| | | {
|
| | | #if !UNITY_EDITOR
|
| | | try
|
| | | {
|
| | | var tables = new Dictionary<string, string>();
|
| | |
| | | {
|
| | | Debug.LogError("BugReportSys error" + ex);
|
| | | }
|
| | |
|
| | | #endif
|
| | | }
|
| | |
|
| | |
|
| | |
| | | } |
| | | } |
| | | |
| | | public static int AllSecondsCrossServer |
| | | { |
| | | get |
| | | { |
| | | TimeSpan t = CrossServerNow - OriginalTime; |
| | | return (int)t.TotalSeconds; |
| | | } |
| | | } |
| | | |
| | | //1年中的第几周,以服务端为准,python和c#算出来不一样 |
| | | public static int WeekOfYear |
| | | { |
| | |
| | | OnServerTimeRefresh(); |
| | | } |
| | | |
| | | s_CrossServerTime = Convert.ToDateTime(vNetData.CrossServerTime); |
| | | _crossCheckTime = Time.realtimeSinceStartup; |
| | | if (!string.IsNullOrEmpty(vNetData.CrossServerTime)) |
| | | { |
| | | s_CrossServerTime = Convert.ToDateTime(vNetData.CrossServerTime); |
| | | _crossCheckTime = Time.realtimeSinceStartup; |
| | | } |
| | | |
| | | TimeDownMgr.Instance.Begin(TimeDownMgr.CoolTimeType.SyncServerTime, 60, (float tick) => |
| | | { |
| | |
| | | { |
| | | return (int)(GetTodayEndTime() - ServerNow).TotalSeconds; |
| | | } |
| | | |
| | | #region 跨服和本服公用接口 |
| | | //当有的功能会从本服功能变成跨服功能的时候统一用这些接口处理时间 |
| | | //各自的功能传自己的zoneID |
| | | |
| | | // 获取当前时间, 公会跨区前取本服时间,跨服后取跨服时间 |
| | | public static DateTime GetCommServerNow(int zoneID = 0) |
| | | { |
| | | if (zoneID == 0) |
| | | { |
| | | return ServerNow; |
| | | } |
| | | else |
| | | { |
| | | return CrossServerNow; |
| | | } |
| | | } |
| | | |
| | | public static int GetCommServerTick(int zoneID = 0) |
| | | { |
| | | if (zoneID == 0) |
| | | { |
| | | return AllSeconds; |
| | | } |
| | | else |
| | | { |
| | | return AllSecondsCrossServer; |
| | | } |
| | | } |
| | | |
| | | public static DateTime GetCommTodayEndTime(int zoneID = 0) |
| | | { |
| | | var now = GetCommServerNow(zoneID).AddDays(1); |
| | | return new DateTime(now.Year, now.Month, now.Day); |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void ShowServersPanel(List<int> serverIDList) |
| | | { |
| | | if (UIManager.Instance.IsOpened<ServersSmallTipWin>()) |
| | | { |
| | | UIManager.Instance.CloseWindow<ServersSmallTipWin>(); |
| | | } |
| | | ServersSmallTipWin.serverIDList = serverIDList; |
| | | UIManager.Instance.OpenWindow<ServersSmallTipWin>(); |
| | | } |
| | | |
| | | } |