8 文件已重命名
26个文件已修改
22个文件已删除
37 文件已复制
42个文件已添加
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | static int order=1; |
| | | protected virtual void Awake() |
| | | { |
| | | order++; |
| | | StencilID = order; |
| | | m_RectTransform = GetComponent<RectTransform>(); |
| | | |
| | | // 创建遮罩图像 |
| | |
| | | typeof(LLMJConfig),
|
| | | typeof(MainChapterConfig),
|
| | | typeof(MainLevelConfig),
|
| | | typeof(ModelConfig),
|
| | | typeof(NPCConfig),
|
| | | typeof(NPCExConfig),
|
| | | typeof(NPCLineupConfig),
|
| | | typeof(OrderInfoConfig),
|
| | | typeof(PlayerAttrConfig),
|
| | | typeof(PlayerFaceConfig),
|
| | | typeof(PriorBundleConfig),
|
| | | typeof(RandomNameConfig),
|
| | | typeof(SignInConfig),
|
| | | typeof(StoreConfig),
|
| | | typeof(SuccessConfig),
|
| | | typeof(SysInfoConfig),
|
| | | typeof(TianziConfig),
|
| | | typeof(TitleConfig),
|
| | | typeof(TitleStarUpConfig),
|
| | | typeof(TreasureSetConfig),
|
| | | typeof(TreeLVConfig),
|
| | |
| | | ClearConfigDictionary<MainChapterConfig>();
|
| | | // 清空 MainLevelConfig 字典
|
| | | ClearConfigDictionary<MainLevelConfig>();
|
| | | // 清空 ModelConfig 字典
|
| | | ClearConfigDictionary<ModelConfig>();
|
| | | // 清空 NPCConfig 字典
|
| | | ClearConfigDictionary<NPCConfig>();
|
| | | // 清空 NPCExConfig 字典
|
| | |
| | | ClearConfigDictionary<PlayerAttrConfig>();
|
| | | // 清空 PlayerFaceConfig 字典
|
| | | ClearConfigDictionary<PlayerFaceConfig>();
|
| | | // 清空 PriorBundleConfig 字典
|
| | | ClearConfigDictionary<PriorBundleConfig>();
|
| | | // 清空 RandomNameConfig 字典
|
| | | ClearConfigDictionary<RandomNameConfig>();
|
| | | // 清空 SignInConfig 字典
|
| | |
| | | ClearConfigDictionary<SysInfoConfig>();
|
| | | // 清空 TianziConfig 字典
|
| | | ClearConfigDictionary<TianziConfig>();
|
| | | // 清空 TitleConfig 字典
|
| | | ClearConfigDictionary<TitleConfig>();
|
| | | // 清空 TitleStarUpConfig 字典
|
| | | ClearConfigDictionary<TitleStarUpConfig>();
|
| | | // 清空 TreasureSetConfig 字典
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年11月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | |
|
| | | public int ID;
|
| | | public string Name;
|
| | | public int NeedLV;
|
| | | public int SortNum;
|
| | | public int UnlockDefault;
|
| | | public int ResourceType;
|
| | | public string ResourceValue;
|
| | | public int ExpireMinutes;
|
| | | public int[][] UnlockNeedItemList;
|
| | | public int[] LightAttrType;
|
| | | public int[] LightAttrValue;
|
| | | public int LightFightPower;
|
| | | public string leftBubbleIcon;
|
| | | public string rightBubbleIcon;
|
| | | public int[] leftOffset;
|
| | | public int[] rightOffset;
|
| | | public string Icon;
|
| | | public int Jump;
|
| | | public string GainTip;
|
| | | public int[] color;
|
| | | public int top;
|
| | | public string Descriptive;
|
| | | public int UnlockWay;
|
| | | public int UnlockValue;
|
| | | public int UnlockNeedCnt;
|
| | | public int UpNeedCnt;
|
| | | public int StarMax;
|
| | | public int[] AttrIDList;
|
| | | public int[] InitAttrValueList;
|
| | | public int[] AttrPerStarAddList;
|
| | | public string GetWayString;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out NeedLV); |
| | | int.TryParse(tables[2],out ResourceType); |
| | |
|
| | | int.TryParse(tables[3],out SortNum); |
| | | ResourceValue = tables[3];
|
| | |
|
| | | int.TryParse(tables[4],out UnlockDefault); |
| | | int.TryParse(tables[4],out ExpireMinutes); |
| | |
|
| | | int.TryParse(tables[5],out ExpireMinutes); |
| | | int.TryParse(tables[5],out UnlockWay); |
| | |
|
| | | UnlockNeedItemList = JsonMapper.ToObject<int[][]>(tables[6].Replace("(", "[").Replace(")", "]")); |
| | | int.TryParse(tables[6],out UnlockValue); |
| | |
|
| | | if (tables[7].Contains("[")) |
| | | int.TryParse(tables[7],out UnlockNeedCnt); |
| | |
|
| | | int.TryParse(tables[8],out UpNeedCnt); |
| | |
|
| | | int.TryParse(tables[9],out StarMax); |
| | |
|
| | | if (tables[10].Contains("[")) |
| | | { |
| | | LightAttrType = JsonMapper.ToObject<int[]>(tables[7]); |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[10]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrTypeStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrType = new int[LightAttrTypeStringArray.Length]; |
| | | for (int i=0;i<LightAttrTypeStringArray.Length;i++) |
| | | string[] AttrIDListStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrIDList = new int[AttrIDListStringArray.Length]; |
| | | for (int i=0;i<AttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrTypeStringArray[i],out LightAttrType[i]); |
| | | int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[8].Contains("[")) |
| | | if (tables[11].Contains("[")) |
| | | { |
| | | LightAttrValue = JsonMapper.ToObject<int[]>(tables[8]); |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrValueStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrValue = new int[LightAttrValueStringArray.Length]; |
| | | for (int i=0;i<LightAttrValueStringArray.Length;i++) |
| | | string[] InitAttrValueListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | InitAttrValueList = new int[InitAttrValueListStringArray.Length]; |
| | | for (int i=0;i<InitAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrValueStringArray[i],out LightAttrValue[i]); |
| | | int.TryParse(InitAttrValueListStringArray[i],out InitAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[9],out LightFightPower); |
| | |
|
| | | leftBubbleIcon = tables[10];
|
| | |
|
| | | rightBubbleIcon = tables[11];
|
| | |
|
| | | if (tables[12].Contains("[")) |
| | | { |
| | | leftOffset = JsonMapper.ToObject<int[]>(tables[12]); |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] leftOffsetStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | leftOffset = new int[leftOffsetStringArray.Length]; |
| | | for (int i=0;i<leftOffsetStringArray.Length;i++) |
| | | string[] AttrPerStarAddListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrPerStarAddList = new int[AttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<AttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(leftOffsetStringArray[i],out leftOffset[i]); |
| | | int.TryParse(AttrPerStarAddListStringArray[i],out AttrPerStarAddList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[13].Contains("[")) |
| | | { |
| | | rightOffset = JsonMapper.ToObject<int[]>(tables[13]); |
| | | } |
| | | else |
| | | { |
| | | string[] rightOffsetStringArray = tables[13].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | rightOffset = new int[rightOffsetStringArray.Length]; |
| | | for (int i=0;i<rightOffsetStringArray.Length;i++) |
| | | { |
| | | int.TryParse(rightOffsetStringArray[i],out rightOffset[i]); |
| | | } |
| | | }
|
| | |
|
| | | Icon = tables[14];
|
| | |
|
| | | int.TryParse(tables[15],out Jump); |
| | |
|
| | | GainTip = tables[16];
|
| | |
|
| | | if (tables[17].Contains("[")) |
| | | { |
| | | color = JsonMapper.ToObject<int[]>(tables[17]); |
| | | } |
| | | else |
| | | { |
| | | string[] colorStringArray = tables[17].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | color = new int[colorStringArray.Length]; |
| | | for (int i=0;i<colorStringArray.Length;i++) |
| | | { |
| | | int.TryParse(colorStringArray[i],out color[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[18],out top); |
| | |
|
| | | Descriptive = tables[19];
|
| | | GetWayString = tables[13];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年11月18日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class ModelConfig : ConfigBase<int, ModelConfig> |
| | | { |
| | | static ModelConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int ID; |
| | | public int TabType; |
| | | public string Name; |
| | | public string FaceBg; |
| | | public int SkinID; |
| | | public int ExpireMinutes; |
| | | public int UnlockWay; |
| | | public int UnlockValue; |
| | | public int UnlockNeedCnt; |
| | | public int UpNeedCnt; |
| | | public int StarMax; |
| | | public int[] AttrIDList; |
| | | public int[] InitAttrValueList; |
| | | public int[] AttrPerStarAddList; |
| | | public string GetWayString; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out ID); |
| | | |
| | | int.TryParse(tables[1],out TabType); |
| | | |
| | | Name = tables[2]; |
| | | |
| | | FaceBg = tables[3]; |
| | | |
| | | int.TryParse(tables[4],out SkinID); |
| | | |
| | | int.TryParse(tables[5],out ExpireMinutes); |
| | | |
| | | int.TryParse(tables[6],out UnlockWay); |
| | | |
| | | int.TryParse(tables[7],out UnlockValue); |
| | | |
| | | int.TryParse(tables[8],out UnlockNeedCnt); |
| | | |
| | | int.TryParse(tables[9],out UpNeedCnt); |
| | | |
| | | int.TryParse(tables[10],out StarMax); |
| | | |
| | | if (tables[11].Contains("[")) |
| | | { |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrIDListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrIDList = new int[AttrIDListStringArray.Length]; |
| | | for (int i=0;i<AttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[12].Contains("[")) |
| | | { |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] InitAttrValueListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | InitAttrValueList = new int[InitAttrValueListStringArray.Length]; |
| | | for (int i=0;i<InitAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(InitAttrValueListStringArray[i],out InitAttrValueList[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[13].Contains("[")) |
| | | { |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[13]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrPerStarAddListStringArray = tables[13].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrPerStarAddList = new int[AttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<AttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrPerStarAddListStringArray[i],out AttrPerStarAddList[i]); |
| | | } |
| | | } |
| | | |
| | | GetWayString = tables[14]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Config/Configs/ModelConfig.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 5d32887e6728d224a8c67d4a3b9227bb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: Wednesday, November 19, 2025
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | |
|
| | | public int FaceID;
|
| | | public string Name;
|
| | | public int[] JobShowList;
|
| | | public int UnlockDefault;
|
| | | public int ExpireMinutes;
|
| | | public int CustomPlayerID;
|
| | | public string Image;
|
| | | public int ResourceType;
|
| | | public string ResourceValue;
|
| | | public int BgColor;
|
| | | public int EffectID;
|
| | | public int[][] UnlockNeedItemList;
|
| | | public int[] LightAttrType;
|
| | | public int[] LightAttrValue;
|
| | | public int LightFightPower;
|
| | | public string Descriptive;
|
| | | public int ExpireMinutes;
|
| | | public int UnlockWay;
|
| | | public int UnlockValue;
|
| | | public int UnlockNeedCnt;
|
| | | public int UpNeedCnt;
|
| | | public int StarMax;
|
| | | public int[] AttrIDList;
|
| | | public int[] InitAttrValueList;
|
| | | public int[] AttrPerStarAddList;
|
| | | public string GetWayString;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | if (tables[2].Contains("[")) |
| | | { |
| | | JobShowList = JsonMapper.ToObject<int[]>(tables[2]); |
| | | } |
| | | else |
| | | { |
| | | string[] JobShowListStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | JobShowList = new int[JobShowListStringArray.Length]; |
| | | for (int i=0;i<JobShowListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(JobShowListStringArray[i],out JobShowList[i]); |
| | | } |
| | | }
|
| | | int.TryParse(tables[2],out ResourceType); |
| | |
|
| | | int.TryParse(tables[3],out UnlockDefault); |
| | | ResourceValue = tables[3];
|
| | |
|
| | | int.TryParse(tables[4],out ExpireMinutes); |
| | | int.TryParse(tables[4],out BgColor); |
| | |
|
| | | int.TryParse(tables[5],out CustomPlayerID); |
| | | int.TryParse(tables[5],out ExpireMinutes); |
| | |
|
| | | Image = tables[6];
|
| | | int.TryParse(tables[6],out UnlockWay); |
| | |
|
| | | int.TryParse(tables[7],out BgColor); |
| | | int.TryParse(tables[7],out UnlockValue); |
| | |
|
| | | int.TryParse(tables[8],out EffectID); |
| | | int.TryParse(tables[8],out UnlockNeedCnt); |
| | |
|
| | | UnlockNeedItemList = JsonMapper.ToObject<int[][]>(tables[9].Replace("(", "[").Replace(")", "]")); |
| | | int.TryParse(tables[9],out UpNeedCnt); |
| | |
|
| | | if (tables[10].Contains("[")) |
| | | { |
| | | LightAttrType = JsonMapper.ToObject<int[]>(tables[10]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrTypeStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrType = new int[LightAttrTypeStringArray.Length]; |
| | | for (int i=0;i<LightAttrTypeStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrTypeStringArray[i],out LightAttrType[i]); |
| | | } |
| | | }
|
| | | int.TryParse(tables[10],out StarMax); |
| | |
|
| | | if (tables[11].Contains("[")) |
| | | { |
| | | LightAttrValue = JsonMapper.ToObject<int[]>(tables[11]); |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrValueStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrValue = new int[LightAttrValueStringArray.Length]; |
| | | for (int i=0;i<LightAttrValueStringArray.Length;i++) |
| | | string[] AttrIDListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrIDList = new int[AttrIDListStringArray.Length]; |
| | | for (int i=0;i<AttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrValueStringArray[i],out LightAttrValue[i]); |
| | | int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[12],out LightFightPower); |
| | | if (tables[12].Contains("[")) |
| | | { |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] InitAttrValueListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | InitAttrValueList = new int[InitAttrValueListStringArray.Length]; |
| | | for (int i=0;i<InitAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(InitAttrValueListStringArray[i],out InitAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | Descriptive = tables[13];
|
| | | if (tables[13].Contains("[")) |
| | | { |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[13]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrPerStarAddListStringArray = tables[13].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrPerStarAddList = new int[AttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<AttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrPerStarAddListStringArray[i],out AttrPerStarAddList[i]); |
| | | } |
| | | }
|
| | |
|
| | | GetWayString = tables[14];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年8月5日
|
| | | // [ Date ]: 2025年11月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | |
| | |
|
| | | public int FacePicID;
|
| | | public string Name;
|
| | | public string Image;
|
| | | public int SortNum;
|
| | | public int EffectID;
|
| | | public int UnlockDefault;
|
| | | public int ResourceType;
|
| | | public string ResourceValue;
|
| | | public int ExpireMinutes;
|
| | | public int[][] UnlockNeedItemList;
|
| | | public int[] LightAttrType;
|
| | | public int[] LightAttrValue;
|
| | | public int LightFightPower;
|
| | | public string Descriptive;
|
| | | public int UnlockWay;
|
| | | public int UnlockValue;
|
| | | public int UnlockNeedCnt;
|
| | | public int UpNeedCnt;
|
| | | public int StarMax;
|
| | | public int[] AttrIDList;
|
| | | public int[] InitAttrValueList;
|
| | | public int[] AttrPerStarAddList;
|
| | | public string GetWayString;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | Image = tables[2];
|
| | | int.TryParse(tables[2],out ResourceType); |
| | |
|
| | | int.TryParse(tables[3],out SortNum); |
| | | ResourceValue = tables[3];
|
| | |
|
| | | int.TryParse(tables[4],out EffectID); |
| | | int.TryParse(tables[4],out ExpireMinutes); |
| | |
|
| | | int.TryParse(tables[5],out UnlockDefault); |
| | | int.TryParse(tables[5],out UnlockWay); |
| | |
|
| | | int.TryParse(tables[6],out ExpireMinutes); |
| | | int.TryParse(tables[6],out UnlockValue); |
| | |
|
| | | UnlockNeedItemList = JsonMapper.ToObject<int[][]>(tables[7].Replace("(", "[").Replace(")", "]")); |
| | | int.TryParse(tables[7],out UnlockNeedCnt); |
| | |
|
| | | if (tables[8].Contains("[")) |
| | | int.TryParse(tables[8],out UpNeedCnt); |
| | |
|
| | | int.TryParse(tables[9],out StarMax); |
| | |
|
| | | if (tables[10].Contains("[")) |
| | | { |
| | | LightAttrType = JsonMapper.ToObject<int[]>(tables[8]); |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[10]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrTypeStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrType = new int[LightAttrTypeStringArray.Length]; |
| | | for (int i=0;i<LightAttrTypeStringArray.Length;i++) |
| | | string[] AttrIDListStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrIDList = new int[AttrIDListStringArray.Length]; |
| | | for (int i=0;i<AttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrTypeStringArray[i],out LightAttrType[i]); |
| | | int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[9].Contains("[")) |
| | | if (tables[11].Contains("[")) |
| | | { |
| | | LightAttrValue = JsonMapper.ToObject<int[]>(tables[9]); |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] LightAttrValueStringArray = tables[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | LightAttrValue = new int[LightAttrValueStringArray.Length]; |
| | | for (int i=0;i<LightAttrValueStringArray.Length;i++) |
| | | string[] InitAttrValueListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | InitAttrValueList = new int[InitAttrValueListStringArray.Length]; |
| | | for (int i=0;i<InitAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(LightAttrValueStringArray[i],out LightAttrValue[i]); |
| | | int.TryParse(InitAttrValueListStringArray[i],out InitAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | int.TryParse(tables[10],out LightFightPower); |
| | | if (tables[12].Contains("[")) |
| | | { |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrPerStarAddListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrPerStarAddList = new int[AttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<AttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrPerStarAddListStringArray[i],out AttrPerStarAddList[i]); |
| | | } |
| | | }
|
| | |
|
| | | Descriptive = tables[11];
|
| | | GetWayString = tables[13];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年11月18日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class TitleConfig : ConfigBase<int, TitleConfig> |
| | | { |
| | | static TitleConfig() |
| | | { |
| | | // 访问过静态构造函数 |
| | | visit = true; |
| | | } |
| | | |
| | | public int TitleID; |
| | | public int TabType; |
| | | public string Name; |
| | | public int ResourceType; |
| | | public string ResourceValue; |
| | | public int ExpireMinutes; |
| | | public int UnlockWay; |
| | | public int UnlockValue; |
| | | public int UnlockNeedCnt; |
| | | public int UpNeedCnt; |
| | | public int StarMax; |
| | | public int[] AttrIDList; |
| | | public int[] InitAttrValueList; |
| | | public int[] AttrPerStarAddList; |
| | | public string GetWayString; |
| | | |
| | | 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 TitleID); |
| | | |
| | | int.TryParse(tables[1],out TabType); |
| | | |
| | | Name = tables[2]; |
| | | |
| | | int.TryParse(tables[3],out ResourceType); |
| | | |
| | | ResourceValue = tables[4]; |
| | | |
| | | int.TryParse(tables[5],out ExpireMinutes); |
| | | |
| | | int.TryParse(tables[6],out UnlockWay); |
| | | |
| | | int.TryParse(tables[7],out UnlockValue); |
| | | |
| | | int.TryParse(tables[8],out UnlockNeedCnt); |
| | | |
| | | int.TryParse(tables[9],out UpNeedCnt); |
| | | |
| | | int.TryParse(tables[10],out StarMax); |
| | | |
| | | if (tables[11].Contains("[")) |
| | | { |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[11]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrIDListStringArray = tables[11].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrIDList = new int[AttrIDListStringArray.Length]; |
| | | for (int i=0;i<AttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrIDListStringArray[i],out AttrIDList[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[12].Contains("[")) |
| | | { |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] InitAttrValueListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | InitAttrValueList = new int[InitAttrValueListStringArray.Length]; |
| | | for (int i=0;i<InitAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(InitAttrValueListStringArray[i],out InitAttrValueList[i]); |
| | | } |
| | | } |
| | | |
| | | if (tables[13].Contains("[")) |
| | | { |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[13]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrPerStarAddListStringArray = tables[13].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | AttrPerStarAddList = new int[AttrPerStarAddListStringArray.Length]; |
| | | for (int i=0;i<AttrPerStarAddListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(AttrPerStarAddListStringArray[i],out AttrPerStarAddList[i]); |
| | | } |
| | | } |
| | | |
| | | GetWayString = tables[14]; |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Config/Configs/TitleConfig.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: e9a2f986928879e4e82dc649281f0ff3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class ModelConfig : ConfigBase<int, ModelConfig> |
| | | { |
| | | //<TabType,List<TitleID>> |
| | | static Dictionary<int, List<int>> tabTypeDict = new Dictionary<int, List<int>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!tabTypeDict.ContainsKey(TabType)) |
| | | { |
| | | tabTypeDict[TabType] = new List<int>(); |
| | | } |
| | | tabTypeDict[TabType].Add(ID); |
| | | } |
| | | |
| | | public static List<int> GetTabTypeTitles(int tabType) |
| | | { |
| | | if (!tabTypeDict.ContainsKey(tabType)) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return tabTypeDict[tabType]; |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Config/PartialConfigs/ModelConfig.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: ff454609a146675479c45454e1e7e414 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class TitleConfig : ConfigBase<int, TitleConfig> |
| | | { |
| | | //<TabType,List<TitleID>> |
| | | static Dictionary<int, List<int>> tabTypeDict = new Dictionary<int, List<int>>(); |
| | | |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | if (!tabTypeDict.ContainsKey(TabType)) |
| | | { |
| | | tabTypeDict[TabType] = new List<int>(); |
| | | } |
| | | tabTypeDict[TabType].Add(TitleID); |
| | | } |
| | | |
| | | public static List<int> GetTabTypeTitles(int tabType) |
| | | { |
| | | if (!tabTypeDict.ContainsKey(tabType)) |
| | | { |
| | | return new List<int>(); |
| | | } |
| | | return tabTypeDict[tabType]; |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Config/PartialConfigs/TitleConfig.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 166064f5d63bfd14a99728820f9057a7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | public uint copperExtend; //扩展属性6,各项目专用 |
| | | public uint sp; //扩展属性7,各项目专用 |
| | | public uint spExtend; //扩展属性8,各项目专用 |
| | | public uint bubbleId; //扩展属性10,各项目专用 |
| | | public uint chatBox; //扩展属性10,各项目专用 |
| | | public uint ExAttr11; //预留的扩展属性字段,用来存放项目特定的属性121 现金代币(代金券) |
| | | public uint ExAttr16; //预留的扩展属性字段,用来存放项目特定的属性 全身特效 |
| | | public uint ServerGroupId; //服务器组ID |
| | |
| | | public int face;//头像 |
| | | public int facePic;//头像外框 |
| | | public long FightPower; //战斗力 |
| | | |
| | | public int modelMark; //形象 |
| | | public uint coinPointTotal |
| | | { |
| | | private get { return m_coinPointTotal; } |
| | |
| | | copperExtend = _serverInfo.ExAttr6; |
| | | sp = _serverInfo.ExAttr7; |
| | | spExtend = _serverInfo.ExAttr8; |
| | | bubbleId = _serverInfo.ExAttr10; |
| | | ExAttr11 = _serverInfo.ExAttr11; |
| | | leaveGuildInfo = (int)_serverInfo.ExAttr12; |
| | | ExAttr16 = _serverInfo.ExAttr16; |
| | |
| | | equipShowSwitch = _serverInfo.EquipShowSwitch; |
| | | mapRealmSelect = (int)_serverInfo.ExAttr18; |
| | | leaveFamilyTime = (int)_serverInfo.ExAttr19; |
| | | face = (int)_serverInfo.Face; |
| | | facePic = (int)_serverInfo.FacePic; |
| | | |
| | | HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue; |
| | | AttackMode = _serverInfo.AttackMode; |
| | | UseHarmerCount = (int)_serverInfo.FightPoint; //锤子倍数,非战斗力 |
| | | face = (int)_serverInfo.Face; |
| | | facePic = (int)_serverInfo.FacePic; |
| | | modelMark = (int)_serverInfo.ModelMark; |
| | | chatBox = (uint)_serverInfo.ExAttr10; |
| | | TitleID = (int)_serverInfo.ExAttr3; |
| | | |
| | | } |
| | | |
| | |
| | | case PlayerDataType.ExAttr2: |
| | | baseData.ExAttr2 = Math.Max((int)value, 10101); //新号初始处理 |
| | | break; |
| | | case PlayerDataType.ExAttr3: |
| | | baseData.dungeonLineId = (int)value % 1000; |
| | | baseData.dungeonMapId = (int)value / 1000; |
| | | case PlayerDataType.ExAttr3://称号 |
| | | baseData.TitleID = (int)value; |
| | | break; |
| | | case PlayerDataType.ExAttr4: |
| | | baseData.shield = value; |
| | |
| | | baseData.copperExtend = value; |
| | | break; |
| | | case PlayerDataType.ExAttr10: |
| | | baseData.bubbleId = value; |
| | | baseData.chatBox = value; |
| | | break; |
| | | case PlayerDataType.ExAttr11: |
| | | baseData.ExAttr11 = value; |
| | |
| | | case PlayerDataType.FacePic: |
| | | baseData.facePic = (int)value; |
| | | break; |
| | | |
| | | case PlayerDataType.ModelMark: |
| | | baseData.modelMark = (int)value; |
| | | break; |
| | | } |
| | | } |
| | | |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 25 幻境阁操作 #tagCSHJGOP |
| | | |
| | | public class CB225_tagCSHJGOP : GameNetPackBasic { |
| | | public byte Type; // 类型 1-形象;2-头像;3-头像框;4-气泡;5-称号 |
| | | public byte OPType; // 操作 1-激活;2-佩戴;3-卸下;4-升星 |
| | | public uint OPID; // 操作对应的ID,如形象ID等 |
| | | |
| | | public CB225_tagCSHJGOP () { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xB225; |
| | | } |
| | | |
| | | public override void WriteToBytes () { |
| | | WriteBytes (Type, NetDataType.BYTE); |
| | | WriteBytes (OPType, NetDataType.BYTE); |
| | | WriteBytes (OPID, NetDataType.DWORD); |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CB2_NewFunction/CB225_tagCSHJGOP.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 5f0f67735acb316478945f53ab8c8abd |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | // B1 17 头像信息 #tagMCFaceInfo
|
| | |
|
| | | public class DTCB117_tagMCFaceInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB117_tagMCFaceInfo vNetData = vNetPack as HB117_tagMCFaceInfo;
|
| | | PhantasmPavilionModel.Instance.UpdateFaceInfo(vNetData);
|
| | | PhantasmPavilionManager.Instance.UpdateFaceInfo(vNetData);
|
| | | }
|
| | | }
|
| | |
| | | // B1 18 头像框信息 #tagMCFacePicInfo
|
| | |
|
| | | public class DTCB118_tagMCFacePicInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | | {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB118_tagMCFacePicInfo vNetData = vNetPack as HB118_tagMCFacePicInfo;
|
| | | PhantasmPavilionModel.Instance.UpdateFacePicInfo(vNetData);
|
| | | PhantasmPavilionManager.Instance.UpdateFacePicInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 19 形象信息 #tagSCModelInfo |
| | | |
| | | public class DTCB119_tagSCModelInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB119_tagSCModelInfo vNetData = vNetPack as HB119_tagSCModelInfo; |
| | | PhantasmPavilionManager.Instance.UpdateModelInfo(vNetData); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB119_tagSCModelInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: b60388212c0c03c41981fd8c354de402 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 26 称号信息 #tagSCTitleInfo |
| | | |
| | | public class DTCB126_tagSCTitleInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB126_tagSCTitleInfo vNetData = vNetPack as HB126_tagSCTitleInfo; |
| | | PhantasmPavilionManager.Instance.UpdateTitleInfo(vNetData); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB126_tagSCTitleInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: f55129cdc6478ab4b967606874a28a35 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 27 聊天气泡框信息 #tagSCChatBoxInfo |
| | | |
| | | public class DTCB127_tagSCChatBoxInfo : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB127_tagSCChatBoxInfo vNetData = vNetPack as HB127_tagSCChatBoxInfo; |
| | | PhantasmPavilionManager.Instance.UpdateChatBoxInfo(vNetData); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB127_tagSCChatBoxInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 7ffa77d347ddbb845b4361e9bc6dd07b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | Register(typeof(HA802_tagSCShopItemBuyCntInfo), typeof(DTCA802_tagSCShopItemBuyCntInfo)); |
| | | Register(typeof(HA803_tagSCShopRefreshItemInfo), typeof(DTCA803_tagSCShopRefreshItemInfo)); |
| | | Register(typeof(HA809_tagMCItemDayUseCntInfo), typeof(DTCA809_tagMCItemDayUseCntInfo)); |
| | | Register(typeof(HA721_tagMCEmojiPackInfo), typeof(DTCA721_tagMCEmojiPackInfo)); |
| | | Register(typeof(HB117_tagMCFaceInfo), typeof(DTCB117_tagMCFaceInfo)); |
| | | Register(typeof(HB118_tagMCFacePicInfo), typeof(DTCB118_tagMCFacePicInfo)); |
| | | Register(typeof(HB120_tagMCZhanlingInfo), typeof(DTCB120_tagMCZhanlingInfo)); |
| | |
| | | Register(typeof(HA921_tagSCRenameResult), typeof(DTCA921_tagSCRenameResult)); |
| | | Register(typeof(HA303_tagSCHorseClassInfo), typeof(DTCA303_tagSCHorseClassInfo)); |
| | | Register(typeof(HA304_tagSCHorseSkinInfo), typeof(DTCA304_tagSCHorseSkinInfo)); |
| | | |
| | | Register(typeof(HB119_tagSCModelInfo), typeof(DTCB119_tagSCModelInfo)); |
| | | Register(typeof(HB126_tagSCTitleInfo), typeof(DTCB126_tagSCTitleInfo)); |
| | | Register(typeof(HB127_tagSCChatBoxInfo), typeof(DTCB127_tagSCChatBoxInfo)); |
| | | |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 19 形象信息 #tagSCModelInfo |
| | | |
| | | public class HB119_tagSCModelInfo : GameNetPackBasic { |
| | | public byte Count; |
| | | public tagSCModel[] ModelList; |
| | | |
| | | public HB119_tagSCModelInfo () { |
| | | _cmd = (ushort)0xB119; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Count, vBytes, NetDataType.BYTE); |
| | | ModelList = new tagSCModel[Count]; |
| | | for (int i = 0; i < Count; i ++) { |
| | | ModelList[i] = new tagSCModel(); |
| | | TransBytes (out ModelList[i].ModelID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out ModelList[i].State, vBytes, NetDataType.BYTE); |
| | | TransBytes (out ModelList[i].EndTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out ModelList[i].Star, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | |
| | | public class tagSCModel { |
| | | public uint ModelID; //形象ID |
| | | public byte State; //是否已激活 |
| | | public uint EndTime; //到期时间戳,0为永久 |
| | | public byte Star; //星级 |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB119_tagSCModelInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: ccf5a2f55a06f274c8c195bcc9599040 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B1 26 称号信息 #tagSCTitleInfo |
| | | |
| | | public class HB126_tagSCTitleInfo : GameNetPackBasic { |
| | | public byte Count; |
| | | public tagSCTitle[] TitleList; |
| | | |
| | | public HB126_tagSCTitleInfo () { |
| | | _cmd = (ushort)0xB126; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Count, vBytes, NetDataType.BYTE); |
| | | TitleList = new tagSCTitle[Count]; |
| | | for (int i = 0; i < Count; i ++) { |
| | | TitleList[i] = new tagSCTitle(); |
| | | TransBytes (out TitleList[i].TitleID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out TitleList[i].State, vBytes, NetDataType.BYTE); |
| | | TransBytes (out TitleList[i].EndTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out TitleList[i].Star, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | |
| | | public class tagSCTitle { |
| | | public uint TitleID; //称号ID |
| | | public byte State; //是否已激活 |
| | | public uint EndTime; //到期时间戳,0为永久 |
| | | public byte Star; //星级 |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB126_tagSCTitleInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 425c648daf9d77f48b10b6a8a09665c6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| File was renamed from Main/Core/NetworkPackage/ServerPack/HA7_Interaction/HA717_tagMCChatBubbleBoxState.cs |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A7 17 聊天气泡框状态 #tagMCChatBubbleBoxState |
| | | // B1 27 聊天气泡框信息 #tagSCChatBoxInfo |
| | | |
| | | public class HA717_tagMCChatBubbleBoxState : GameNetPackBasic { |
| | | public class HB127_tagSCChatBoxInfo : GameNetPackBasic { |
| | | public byte Count; |
| | | public tagMCChatBubbleBox[] BoxList; |
| | | public tagSCChatBox[] BoxList; |
| | | |
| | | public HA717_tagMCChatBubbleBoxState () { |
| | | _cmd = (ushort)0xA717; |
| | | public HB127_tagSCChatBoxInfo () { |
| | | _cmd = (ushort)0xB127; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out Count, vBytes, NetDataType.BYTE); |
| | | BoxList = new tagMCChatBubbleBox[Count]; |
| | | BoxList = new tagSCChatBox[Count]; |
| | | for (int i = 0; i < Count; i ++) { |
| | | BoxList[i] = new tagMCChatBubbleBox(); |
| | | TransBytes (out BoxList[i].BoxID, vBytes, NetDataType.BYTE); |
| | | BoxList[i] = new tagSCChatBox(); |
| | | TransBytes (out BoxList[i].BoxID, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BoxList[i].State, vBytes, NetDataType.BYTE); |
| | | TransBytes (out BoxList[i].EndTime, vBytes, NetDataType.DWORD); |
| | | TransBytes (out BoxList[i].Star, vBytes, NetDataType.BYTE); |
| | | } |
| | | } |
| | | |
| | | public class tagMCChatBubbleBox { |
| | | public byte BoxID; //气泡ID |
| | | public class tagSCChatBox { |
| | | public uint BoxID; //气泡框ID |
| | | public byte State; //是否已激活 |
| | | public uint EndTime; //到期时间戳,0为永久 |
| | | public byte Star; //星级 |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB127_tagSCChatBoxInfo.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 62844095792db2c40bd630462e650322 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | managers.Add(OtherPlayerDetailManager.Instance);
|
| | | managers.Add(RechargeManager.Instance);
|
| | | managers.Add(StoreModel.Instance);
|
| | | managers.Add(PhantasmPavilionModel.Instance);
|
| | | managers.Add(GuildManager.Instance);
|
| | | managers.Add(TeamManager.Instance);
|
| | | managers.Add(TaskManager.Instance);
|
| | |
| | | managers.Add(RenameManager.Instance);
|
| | | managers.Add(AchievementManager.Instance);
|
| | | managers.Add(HorseManager.Instance);
|
| | |
|
| | | managers.Add(PhantasmPavilionManager.Instance);
|
| | | managers.Add(AttributeManager.Instance);
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ecabae745862c6d4b9e865c3e9d775cf |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class AttributeManager : GameSystemManager<AttributeManager> |
| | | { |
| | | public Dictionary<int, long> totalAttrDict = new Dictionary<int, long>(); |
| | | public void OpenTotalAttributeWin(Dictionary<int, long> totalAttrDict, int functionOrder = 0) |
| | | { |
| | | this.totalAttrDict = totalAttrDict; |
| | | if (!UIManager.Instance.IsOpened<TotalAttributeWin>()) |
| | | { |
| | | UIManager.Instance.OpenWindow<TotalAttributeWin>(functionOrder); |
| | | } |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/Attribute/AttributeManager.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 1ff6398b3797afb4eb0fd9633ac75cfe |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| File was renamed from Main/System/HeroUI/HeroAllAttrWin.cs |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 武将属性界面: functionOrder 用来传递武将背包索引 |
| | | /// </summary> |
| | | public class HeroAllAttrWin : UIBase |
| | | public class TotalAttributeWin : UIBase |
| | | { |
| | | [SerializeField] Transform allContent; |
| | | [SerializeField] GameObject baseAttrGroup; |
| | | [SerializeField] GameObject fightAttrGroup; |
| | | [SerializeField] GameObject fightAntiAttrGroup; |
| | | [SerializeField] GameObject specialAttrGroup; |
| | | |
| | | |
| | | |
| | | Dictionary<int, Button> attrBtns = new Dictionary<int, Button>(); |
| | | |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | var item = PackManager.Instance.GetItemByIndex(PackType.Hero, functionOrder); |
| | | if (item == null) |
| | | if (AttributeManager.Instance.totalAttrDict.IsNullOrEmpty()) |
| | | return; |
| | | var hero = HeroManager.Instance.GetHero(item.guid); |
| | | if (hero == null) |
| | | return; |
| | | var dict = FightPowerManager.Instance.GetHeroTotalAttr(hero); |
| | | var dict = AttributeManager.Instance.totalAttrDict; |
| | | foreach (var kv in attrBtns) |
| | | { |
| | | //每个按钮下有两个Text:name 和 value |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public Dictionary<int, BubbleBox> bubblesIfo = new Dictionary<int, BubbleBox>(); |
| | | |
| | | public void UpdateBubbleState(HA717_tagMCChatBubbleBoxState package) |
| | | { |
| | | List<int> list = null; |
| | | if (serverInited) |
| | | { |
| | | list = new List<int>(); |
| | | foreach (var id in chatBubbles.Keys) |
| | | { |
| | | if (!IsBubbleGot(id)) |
| | | { |
| | | list.Add(id); |
| | | } |
| | | } |
| | | } |
| | | // public void UpdateBubbleState(HA717_tagMCChatBubbleBoxState package) |
| | | // { |
| | | // List<int> list = null; |
| | | // if (serverInited) |
| | | // { |
| | | // list = new List<int>(); |
| | | // foreach (var id in chatBubbles.Keys) |
| | | // { |
| | | // if (!IsBubbleGot(id)) |
| | | // { |
| | | // list.Add(id); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | for (int i = 0; i < package.Count; i++) |
| | | { |
| | | var info = package.BoxList[i]; |
| | | bubblesIfo[info.BoxID] = new BubbleBox() |
| | | { |
| | | State = info.State, |
| | | EndTime = (int)info.EndTime, |
| | | Star = info.Star, |
| | | }; |
| | | } |
| | | // for (int i = 0; i < package.Count; i++) |
| | | // { |
| | | // var info = package.BoxList[i]; |
| | | // bubblesIfo[info.BoxID] = new BubbleBox() |
| | | // { |
| | | // State = info.State, |
| | | // EndTime = (int)info.EndTime, |
| | | // Star = info.Star, |
| | | // }; |
| | | // } |
| | | |
| | | if (serverInited) |
| | | { |
| | | if (list != null) |
| | | { |
| | | for (int i = 0; i < list.Count; i++) |
| | | { |
| | | if (IsBubbleGot(list[i])) |
| | | { |
| | | SendUseBubble(list[i]); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (chatBubbleStateRefresh != null) |
| | | { |
| | | chatBubbleStateRefresh(); |
| | | } |
| | | } |
| | | // if (serverInited) |
| | | // { |
| | | // if (list != null) |
| | | // { |
| | | // for (int i = 0; i < list.Count; i++) |
| | | // { |
| | | // if (IsBubbleGot(list[i])) |
| | | // { |
| | | // SendUseBubble(list[i]); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (chatBubbleStateRefresh != null) |
| | | // { |
| | | // chatBubbleStateRefresh(); |
| | | // } |
| | | // } |
| | | |
| | | public void SendUseBubble(int id) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (id == PlayerDatas.Instance.baseData.bubbleId) |
| | | if (id == PlayerDatas.Instance.baseData.chatBox) |
| | | { |
| | | return; |
| | | } |
| | | CA230_tagCMSetChatBubbleBox pak = new CA230_tagCMSetChatBubbleBox(); |
| | | pak.BubbleBoxType = (byte)id; |
| | | GameNetSystem.Instance.SendInfo(pak); |
| | | // CA230_tagCMSetChatBubbleBox pak = new CA230_tagCMSetChatBubbleBox(); |
| | | // pak.BubbleBoxType = (byte)id; |
| | | // GameNetSystem.Instance.SendInfo(pak); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | { |
| | | var vipLevel = PlayerDatas.Instance.baseData.VIPLv; |
| | | var job = PlayerDatas.Instance.baseData.Job; |
| | | var bubbleId = PlayerDatas.Instance.baseData.bubbleId; |
| | | var bubbleId = PlayerDatas.Instance.baseData.chatBox; |
| | | var serverGroupId = PlayerDatas.Instance.baseData.ServerGroupId; |
| | | return StringUtility.Contact(vipLevel.ToString().PadLeft(2, '0'), 0, job, |
| | | bubbleId.ToString().PadLeft(2, '0'), serverGroupId.ToString().PadLeft(7, '0')); |
| | |
| | | |
| | | allAttrBtn.AddListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<HeroAllAttrWin>(hero.itemHero.gridIndex); |
| | | var item = PackManager.Instance.GetItemByIndex(PackType.Hero, functionOrder); |
| | | if (item == null) |
| | | return; |
| | | var hero = HeroManager.Instance.GetHero(item.guid); |
| | | if (hero == null) |
| | | return; |
| | | var dict = FightPowerManager.Instance.GetHeroTotalAttr(hero); |
| | | AttributeManager.Instance.OpenTotalAttributeWin(dict, hero.itemHero.gridIndex); |
| | | }); |
| | | lvupBtn.AddListener(LVUp); |
| | | lvupBtn.onPress.AddListener(LVUp); |
| | |
| | | lvupEffect.Play(); |
| | | var cell = RequestCell(); |
| | | cell.transform.localPosition = new Vector3(0, 0, 0); |
| | | cell.Display(hero.qualityConfig.LVAddPer, ()=> |
| | | { |
| | | cell.Display(hero.qualityConfig.LVAddPer, () => |
| | | { |
| | | cell.SetActive(false); |
| | | ReturnCell(cell); |
| | | }); |
| | |
| | | |
| | | HeroTrainAddAttrCell RequestCell() |
| | | { |
| | | |
| | | |
| | | if (lvupAttrQueue.Count == 0) |
| | | { |
| | | return Instantiate(addPerObject, addPerParent); |
| | |
| | | return; |
| | | } |
| | | newHeroIDList.Add(heroID); |
| | | |
| | | PhantasmPavilionManager.Instance.AddNewHero(heroID); |
| | | } |
| | | |
| | | public void RemoveNewHero(int heroID) |
| | |
| | | { |
| | | UIManager.Instance.OpenWindow<GoldRushWorkerWin>(); |
| | | } |
| | | |
| | | if (funcID == 42) |
| | | { |
| | | UIManager.Instance.OpenWindow<PhantasmPavilionWin>(); |
| | | } |
| | | // else if (funcID == 214) |
| | | // { |
| | | // GoldRushManager.Instance.NotifyGoldRushEvent(0, 0, 2); |
| | |
| | | propertyVariables["realmPer"] = GetOfficialPer(attrType) / 10000.0f; |
| | | propertyVariables["gubaoValue"] = 0; |
| | | propertyVariables["gubaoPer"] = 0; |
| | | propertyVariables["hjgValue"] = 0; |
| | | propertyVariables["hjgPer"] = 0; |
| | | propertyVariables["hjgValue"] = PhantasmPavilionManager.Instance.GetAttrValue(attrType); |
| | | propertyVariables["hjgPer"] = PhantasmPavilionManager.Instance.GetAttrPer(attrType) / 10000.0f; |
| | | propertyVariables["horseValue"] = HorseManager.Instance.GetAttrValue(attrType); |
| | | propertyVariables["horsePer"] = HorseManager.Instance.GetAttrPer(attrType) / 10000.0f; |
| | | |
| | |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | |
| | | avatarCell.redpoint.redpointId = MainRedDot.PhantasmPavilionRepoint; |
| | | avatarCell.button.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<PlayerProfileWin>(); |
| | |
| | | private Image officialRankObj |
| | | { |
| | | get |
| | | { |
| | | { |
| | | if (m_OfficialRankObj == null) |
| | | { |
| | | m_OfficialRankObj = this.GetComponent<Image>("OfficialTitleCell/offcialRank"); |
| | |
| | | Text m_OfficialRankText; |
| | | private Text officialRankText |
| | | { |
| | | get |
| | | { |
| | | get |
| | | { |
| | | if (m_OfficialRankText == null) |
| | | { |
| | | m_OfficialRankText = this.GetComponent<Text>("OfficialTitleCell/offcialRank/text"); |
| | |
| | | } |
| | | } |
| | | |
| | | Image m_TitleImage; |
| | | private Image titleImage |
| | | ImageEx m_TitleImage; |
| | | private ImageEx titleImage |
| | | { |
| | | get |
| | | { |
| | | if (m_TitleImage == null) |
| | | { |
| | | m_TitleImage = this.GetComponent<Image>("OfficialTitleCell/Img_Title"); |
| | | m_TitleImage = this.GetComponent<ImageEx>("OfficialTitleCell/Img_Title"); |
| | | } |
| | | return m_TitleImage; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | UIEffectPlayer m_UIEffectPlayer; |
| | | private UIEffectPlayer effectPlayer |
| | | { |
| | | get |
| | | { |
| | | if (m_UIEffectPlayer == null) |
| | | { |
| | | m_UIEffectPlayer = this.GetComponent<UIEffectPlayer>("OfficialTitleCell/Img_Title/UIEffectPlayer"); |
| | | } |
| | | return m_UIEffectPlayer; |
| | | } |
| | | } |
| | | |
| | | void OnEnable() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh; |
| | | } |
| | | |
| | | void OnDisable() |
| | | { |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh; |
| | | } |
| | | |
| | | private void PlayerDataRefresh(PlayerDataType type) |
| | | { |
| | | if (type == PlayerDataType.ExAttr3) |
| | | { |
| | | InitUI(PlayerDatas.Instance.baseData.realmLevel, PlayerDatas.Instance.baseData.TitleID); |
| | | } |
| | | } |
| | | |
| | | GameObject prefab; |
| | | |
| | |
| | | officialRankObj.SetActive(false); |
| | | titleUIFrame.SetActive(true); |
| | | titleUIFrame.enabled = false; |
| | | var titleConfig = DienstgradConfig.Get(titleID); |
| | | string imgStr = titleConfig.Image; |
| | | if (!FrameAnimationConfig.HasKey(imgStr)) |
| | | { |
| | | titleImage.SetSprite(imgStr); |
| | | titleImage.SetNativeSize(); |
| | | return; |
| | | } |
| | | |
| | | if (UIFrameMgr.Inst.ContainsDynamicImage(imgStr)) |
| | | { |
| | | titleUIFrame.ResetFrame(imgStr); |
| | | |
| | | List<Sprite> spriteList = UIFrameMgr.Inst.GetDynamicImage(imgStr); |
| | | if (!spriteList.IsNullOrEmpty()) |
| | | { |
| | | titleImage.rectTransform.sizeDelta = new Vector2(spriteList[0].rect.width, spriteList[0].rect.height); |
| | | } |
| | | |
| | | titleUIFrame.enabled = true; |
| | | } |
| | | int resourceType = PhantasmPavilionManager.Instance.GetResourceType(PhantasmPavilionType.Title, titleID); |
| | | string resourceValue = PhantasmPavilionManager.Instance.GetResourceValue(PhantasmPavilionType.Title, titleID); |
| | | PhantasmPavilionManager.Instance.Show(titleImage, effectPlayer, titleUIFrame, resourceType, resourceValue); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | |
|
| | | //头像模块(支持帧动画和特效)
|
| | | //头像模块
|
| | | public class AvatarCell : MonoBehaviour
|
| | | {
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | LoadPrefab();
|
| | |
|
| | | }
|
| | | ImageEx m_BgImage;
|
| | | private ImageEx bgImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_BgImage == null)
|
| | | {
|
| | | m_BgImage = this.GetComponent<ImageEx>("AvatarCell/Img_BG");
|
| | | }
|
| | | return m_BgImage;
|
| | | }
|
| | | }
|
| | |
|
| | | ImageEx m_AvatarImage;
|
| | | private ImageEx avatarImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarImage == null)
|
| | | {
|
| | | m_AvatarImage = this.GetComponent<ImageEx>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | }
|
| | | return m_AvatarImage;
|
| | | }
|
| | | }
|
| | |
|
| | | ImageEx m_AvatarFrameImage;
|
| | | private ImageEx avatarFrameImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarFrameImage == null)
|
| | | {
|
| | | m_AvatarFrameImage = this.GetComponent<ImageEx>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | }
|
| | | return m_AvatarFrameImage;
|
| | | }
|
| | | }
|
| | |
|
| | | ButtonEx m_button;
|
| | | public ButtonEx button
|
| | | {
|
| | |
| | | if (m_button == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_button = this.GetComponent<ButtonEx>("AvatarCell/Img_BG");
|
| | | m_button = this.GetComponent<ButtonEx>("AvatarCell/Img_FaceBG");
|
| | | }
|
| | | return m_button;
|
| | | }
|
| | | }
|
| | |
|
| | | UIFrame m_AvatarUIFrame;
|
| | | private UIFrame avatarUIFrame
|
| | | ImageEx m_FaceBGImage;
|
| | | public ImageEx faceBGImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarUIFrame == null)
|
| | | if (m_FaceBGImage == null)
|
| | | {
|
| | | m_AvatarUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | LoadPrefab();
|
| | | m_FaceBGImage = this.GetComponent<ImageEx>("AvatarCell/Img_FaceBG");
|
| | | }
|
| | | return m_AvatarUIFrame;
|
| | | return m_FaceBGImage;
|
| | | }
|
| | | }
|
| | |
|
| | | UIFrame m_AvatarFrameUIFrame;
|
| | | private UIFrame avatarFrameUIFrame
|
| | | EllipseMask m_FaceMask;
|
| | | public EllipseMask faceMask
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarFrameUIFrame == null)
|
| | | if (m_FaceMask == null)
|
| | | {
|
| | | m_AvatarFrameUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | LoadPrefab();
|
| | | m_FaceMask = this.GetComponent<EllipseMask>("AvatarCell/Img_FaceBG/Mask_Face");
|
| | | }
|
| | | return m_AvatarFrameUIFrame;
|
| | | return m_FaceMask;
|
| | | }
|
| | | }
|
| | |
|
| | | UIEffectPlayer m_AvatarUIEffect;
|
| | | private UIEffectPlayer avatarUIEffect
|
| | | UIFrame m_FaceUIFrame;
|
| | | public UIFrame faceUIFrame
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarUIEffect == null)
|
| | | if (m_FaceUIFrame == null)
|
| | | {
|
| | | m_AvatarUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_BG/Img_AvatarFrame/GameObject/Img_Avatar");
|
| | | LoadPrefab();
|
| | | m_FaceUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_FaceBG/Mask_Face/Img_Face");
|
| | | }
|
| | | return m_AvatarUIEffect;
|
| | | return m_FaceUIFrame;
|
| | | }
|
| | | }
|
| | |
|
| | | UIEffectPlayer m_AvatarFrameUIEffect;
|
| | | private UIEffectPlayer avatarFrameUIEffect
|
| | | ImageEx m_FaceImage;
|
| | | public ImageEx faceImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_AvatarFrameUIEffect == null)
|
| | | if (m_FaceImage == null)
|
| | | {
|
| | | m_AvatarFrameUIEffect = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_BG/Img_AvatarFrame");
|
| | | LoadPrefab();
|
| | | m_FaceImage = this.GetComponent<ImageEx>("AvatarCell/Img_FaceBG/Mask_Face/Img_Face");
|
| | | }
|
| | | return m_AvatarFrameUIEffect;
|
| | | return m_FaceImage;
|
| | | }
|
| | | }
|
| | |
|
| | | UIEffectPlayer m_faceSpine;
|
| | | public UIEffectPlayer faceSpine
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_faceSpine == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_faceSpine = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_FaceBG/Mask_Face/Img_Face/Spine_Face");
|
| | | }
|
| | | return m_faceSpine;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | ImageEx m_FacePicImage;
|
| | | public ImageEx facePicImage
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_FacePicImage == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_FacePicImage = this.GetComponent<ImageEx>("AvatarCell/Img_FaceBG/Img_FacePic");
|
| | | }
|
| | | return m_FacePicImage;
|
| | | }
|
| | | }
|
| | |
|
| | | UIFrame m_FacePicUIFrame;
|
| | | public UIFrame facePicUIFrame
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_FacePicUIFrame == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_FacePicUIFrame = this.GetComponent<UIFrame>("AvatarCell/Img_FaceBG/Img_FacePic");
|
| | | }
|
| | | return m_FacePicUIFrame;
|
| | | }
|
| | | }
|
| | |
|
| | | UIEffectPlayer m_facePicSpine;
|
| | | public UIEffectPlayer facePicSpine
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_facePicSpine == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_facePicSpine = this.GetComponent<UIEffectPlayer>("AvatarCell/Img_FaceBG/Img_FacePic/Spine_FacePic");
|
| | | }
|
| | | return m_facePicSpine;
|
| | | }
|
| | | }
|
| | |
|
| | | RedpointBehaviour m_redpoint;
|
| | | public RedpointBehaviour redpoint
|
| | | {
|
| | | get
|
| | | {
|
| | | if (m_redpoint == null)
|
| | | {
|
| | | LoadPrefab();
|
| | | m_redpoint = this.GetComponent<RedpointBehaviour>("AvatarCell/Img_FaceBG/RedPoint");
|
| | | }
|
| | | return m_redpoint;
|
| | | }
|
| | | }
|
| | |
|
| | | GameObject prefab;
|
| | | AvatarModel avatarModel;
|
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
|
| | | private void Awake()
|
| | | {
|
| | | LoadPrefab();
|
| | | }
|
| | |
|
| | | void OnEnable()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
|
| | | }
|
| | |
|
| | | void OnDisable()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
|
| | | }
|
| | |
|
| | | private void PlayerDataRefresh(PlayerDataType type)
|
| | | {
|
| | | if (type == PlayerDataType.Face || type == PlayerDataType.FacePic)
|
| | | {
|
| | | if (avatarModel == null || avatarModel.playerID != PlayerDatas.Instance.baseData.PlayerID)
|
| | | return;
|
| | | InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
|
| | | PlayerDatas.Instance.baseData.face,
|
| | | PlayerDatas.Instance.baseData.facePic));
|
| | | }
|
| | | }
|
| | |
|
| | | protected void LoadPrefab()
|
| | | {
|
| | |
| | | prefabRect.sizeDelta = new Vector2(parentRect.rect.width, parentRect.rect.height);
|
| | | }
|
| | | }
|
| | |
|
| | | public void InitUI(AvatarModel model)
|
| | | {
|
| | | if (model == null)
|
| | | return;
|
| | | avatarModel = model;
|
| | | LoadPrefab(); //存在被卸载的可能,重新加载
|
| | | string img = AvatarHelper.GetAvatarBgColorStr(model.avatarID);
|
| | | bgImage.SetSprite(img);
|
| | | InitUI(model.avatarID, model.avatarUIEffectID, model.avatarFrameID, model.avatarFrameUIEffectID);
|
| | | }
|
| | |
|
| | | private void InitUI(int avatarID, int avatarUIEffectID, int avatarFrameID, int avatarFrameUIEffectID)
|
| | | {
|
| | | InitAvatarUI(avatarID, avatarUIEffectID);
|
| | | InitAvatarFrameUI(avatarFrameID, avatarFrameUIEffectID);
|
| | | }
|
| | | int faceID = model.faceID;
|
| | | int facePicID = model.facePicID;
|
| | | manager.ShowFace(faceImage, faceSpine, faceUIFrame, faceMask, faceID);
|
| | |
|
| | | private void InitAvatarUI(int avatarID, int avatarUIEffectID)
|
| | | {
|
| | | avatarUIEffect?.Stop();
|
| | | avatarUIFrame.enabled = false;
|
| | | if (!PlayerFaceConfig.HasKey(avatarID))
|
| | | return;
|
| | | string str = AvatarHelper.GetAvatarBgColorStr(faceID);
|
| | | faceBGImage.SetSprite(str);
|
| | |
|
| | | PlayerFaceConfig config = PlayerFaceConfig.Get(avatarID);
|
| | | string imgStr = config.Image;
|
| | | if (UIFrameMgr.Inst.ContainsDynamicImage(imgStr))
|
| | | {
|
| | | avatarUIFrame.ResetFrame(imgStr);
|
| | | int resourceType = manager.GetResourceType(PhantasmPavilionType.FacePic, facePicID);
|
| | | string resourceValue = manager.GetResourceValue(PhantasmPavilionType.FacePic, facePicID);
|
| | | manager.Show(facePicImage, facePicSpine, facePicUIFrame, resourceType, resourceValue);
|
| | |
|
| | | List<UnityEngine.Sprite> spriteList = UIFrameMgr.Inst.GetDynamicImage(imgStr);
|
| | | if (!spriteList.IsNullOrEmpty())
|
| | | {
|
| | | avatarImage.rectTransform.sizeDelta = new Vector2(spriteList[0].rect.width, spriteList[0].rect.height);
|
| | | }
|
| | |
|
| | | avatarUIFrame.enabled = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | avatarImage.SetSprite(imgStr);
|
| | | avatarImage.SetNativeSize();
|
| | | avatarUIFrame.enabled = false;
|
| | | }
|
| | |
|
| | | if (!EffectConfig.HasKey(avatarUIEffectID))
|
| | | return;
|
| | | avatarUIEffect.effectId = avatarUIEffectID;
|
| | | // avatarUIEffect.loop = true;
|
| | | avatarUIEffect.Play();
|
| | | }
|
| | |
|
| | | private void InitAvatarFrameUI(int avatarFrameID, int avatarFrameUIEffectID)
|
| | | {
|
| | | avatarFrameUIEffect?.Stop();
|
| | | avatarFrameUIFrame.enabled = false;
|
| | | if (!PlayerFacePicConfig.HasKey(avatarFrameID))
|
| | | return;
|
| | |
|
| | | PlayerFacePicConfig config = PlayerFacePicConfig.Get(avatarFrameID);
|
| | | string imgStr = config.Image;
|
| | | if (UIFrameMgr.Inst.ContainsDynamicImage(imgStr))
|
| | | {
|
| | | avatarFrameUIFrame.ResetFrame(imgStr);
|
| | |
|
| | | List<UnityEngine.Sprite> spriteList = UIFrameMgr.Inst.GetDynamicImage(imgStr);
|
| | | if (!spriteList.IsNullOrEmpty())
|
| | | {
|
| | | avatarFrameImage.rectTransform.sizeDelta = new Vector2(spriteList[0].rect.width, spriteList[0].rect.height);
|
| | | }
|
| | |
|
| | | avatarFrameUIFrame.enabled = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | avatarFrameImage.SetSprite(imgStr);
|
| | | avatarFrameImage.SetNativeSize();
|
| | | avatarFrameUIFrame.enabled = false;
|
| | | }
|
| | |
|
| | | if (!EffectConfig.HasKey(avatarFrameUIEffectID))
|
| | | return;
|
| | | avatarUIEffect.effectId = avatarFrameUIEffectID;
|
| | | // avatarUIEffect.loop = true;
|
| | | avatarUIEffect.Play();
|
| | | faceBGImage.SetNativeSize();
|
| | | faceImage.SetNativeSize();
|
| | | facePicImage.SetNativeSize();
|
| | | }
|
| | | }
|
| | |
|
| | | public class AvatarModel
|
| | | {
|
| | | public int avatarID { get; private set; }
|
| | | public int avatarFrameID { get; private set; }
|
| | | public int avatarUIEffectID { get; private set; }
|
| | | public int avatarFrameUIEffectID { get; private set; }
|
| | | public float scale { get; private set; }
|
| | | public int playerID { get; private set; }
|
| | | public int faceID { get; private set; }
|
| | | public int facePicID { get; private set; }
|
| | | public int redpointID { get; private set; }
|
| | | public Action clickAction { get; private set; }
|
| | |
|
| | | public AvatarModel(int avatarID, int avatarFrameID, int avatarUIEffectID = 0, int avatarFrameUIEffectID = 0)
|
| | | public AvatarModel(int playerID, int faceID, int facePicID, int redpointID = 0, Action clickAction = null)
|
| | | {
|
| | | this.avatarID = avatarID;
|
| | | this.avatarFrameID = avatarFrameID;
|
| | | this.avatarUIEffectID = avatarUIEffectID;
|
| | | this.avatarFrameUIEffectID = avatarFrameUIEffectID;
|
| | | this.playerID = playerID;
|
| | | this.faceID = faceID;
|
| | | this.facePicID = facePicID;
|
| | | this.redpointID = redpointID;
|
| | | this.clickAction = clickAction;
|
| | | }
|
| | | } |
| | |
| | | public static class AvatarHelper
|
| | | {
|
| | |
|
| | | public static AvatarModel GetAvatarModel(int playerId, int face, int facePic, int job = 0)
|
| | | {
|
| | | bool isMyself = playerId == PlayerDatas.Instance.PlayerId;
|
| | | return isMyself ? GetMyAvatarModel() : GetOtherAvatarModel(face, facePic, job);
|
| | | }
|
| | |
|
| | | //获取头像信息(如果表中不存在,返回默认的)
|
| | | public static AvatarModel GetOtherAvatarModel(int face, int facePic, int job = 0)
|
| | | {
|
| | | int nowFace = GetOtherAvatarID(face, job);
|
| | | int nowfacePic = GetOtherAvatarFrameID(facePic, job);
|
| | | int faceEffectID = GetAvatarEffectID(nowFace);
|
| | | int facePicEffectID = GetAvatarFrameDefaultID(nowfacePic);
|
| | | return new AvatarModel(nowFace, nowfacePic, faceEffectID, facePicEffectID);
|
| | | }
|
| | |
|
| | | //获取我的头像信息(如果表中不存在 或 已过期,返回默认的)
|
| | | public static AvatarModel GetMyAvatarModel()
|
| | | {
|
| | | int nowFace = GetMyAvatarID();
|
| | | int nowfacePic = GetMyAvatarFrameID();
|
| | | int faceEffectID = GetAvatarEffectID(nowFace);
|
| | | int facePicEffectID = GetAvatarFrameDefaultID(nowfacePic);
|
| | | return new AvatarModel(nowFace, nowfacePic, faceEffectID, facePicEffectID);
|
| | | }
|
| | |
|
| | | public static AvatarModel GetDefaultAvatarModel(int job = 0)
|
| | | {
|
| | | int nowFace = GetAvatarDefaultID(job);
|
| | | int nowfacePic = GetAvatarFrameDefaultID(job);
|
| | | int faceEffectID = GetAvatarEffectID(nowFace);
|
| | | int facePicEffectID = GetAvatarFrameDefaultID(nowfacePic);
|
| | | return new AvatarModel(nowFace, nowfacePic, faceEffectID, facePicEffectID);
|
| | | int nowFace;
|
| | | int nowfacePic;
|
| | | if (isMyself)
|
| | | {
|
| | | nowFace = GetMyAvatarID();
|
| | | nowfacePic = GetMyAvatarFrameID();
|
| | | }
|
| | | else
|
| | | {
|
| | | nowFace = GetOtherAvatarID(face, job);
|
| | | nowfacePic = GetOtherAvatarFrameID(facePic, job);
|
| | | }
|
| | | return new AvatarModel(playerId, nowFace, nowfacePic);
|
| | | }
|
| | |
|
| | | public static int GetAvatarID(int playerId, int nowID, int job)
|
| | |
| | | // 获取其他玩家头像id(封包中的id在表中不存在显示默认的)
|
| | | public static int GetOtherAvatarID(int nowID, int job)
|
| | | {
|
| | | if (PlayerFaceConfig.HasKey(nowID))
|
| | | return nowID;
|
| | | return PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.Avatar, job, out int defaultID) ? defaultID : 0;
|
| | | int defaultID = GetAvatarDefaultID(job);
|
| | | return PlayerFaceConfig.HasKey(nowID) ? nowID : defaultID;
|
| | | }
|
| | |
|
| | | public static int GetOtherAvatarFrameID(int nowID, int job)
|
| | | {
|
| | | if (PlayerFaceConfig.HasKey(nowID))
|
| | | return nowID;
|
| | | return PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.AvatarFrame, job, out int defaultID) ? defaultID : 0;
|
| | | int defaultID = GetAvatarFrameDefaultID(job);
|
| | | return PlayerFacePicConfig.HasKey(nowID) ? nowID : defaultID;
|
| | | }
|
| | |
|
| | | //返回玩家头像id(当前装备的过期了显示默认的)
|
| | | public static int GetMyAvatarID()
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetNowShowID(PhantasmPavilionTab.Avatar, out int defaultID);
|
| | | return defaultID;
|
| | | return PhantasmPavilionManager.Instance.TryGetNowShowID(PhantasmPavilionType.Face, out int defaultID) ? defaultID : 0;
|
| | | }
|
| | |
|
| | | public static int GetMyAvatarFrameID()
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetNowShowID(PhantasmPavilionTab.AvatarFrame, out int defaultID);
|
| | | return defaultID;
|
| | | int job = PlayerDatas.Instance.baseData.Job;
|
| | | return PhantasmPavilionManager.Instance.TryGetNowShowID(PhantasmPavilionType.FacePic, out int defaultID) ? defaultID : 0;
|
| | | }
|
| | |
|
| | | //根据job 直接返回对应的默认头像id
|
| | | public static int GetAvatarDefaultID(int job)
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.Avatar, job, out int defaultID);
|
| | | return defaultID;
|
| | | return PhantasmPavilionManager.Instance.TryGetDefaultID(PhantasmPavilionType.Face, job, out int defaultID) ? defaultID : 0;
|
| | | }
|
| | |
|
| | | //根据job 直接返回对应的默认头像框id
|
| | | public static int GetAvatarFrameDefaultID(int job)
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.AvatarFrame, job, out int defaultID);
|
| | | return defaultID;
|
| | | return PhantasmPavilionManager.Instance.TryGetDefaultID(PhantasmPavilionType.FacePic, job, out int defaultID) ? defaultID : 0;
|
| | | }
|
| | |
|
| | | public static int GetAvatarEffectID(int id)
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetEffectID(PhantasmPavilionTab.Avatar, id, out int effectID);
|
| | | return effectID;
|
| | | }
|
| | |
|
| | | public static int GetAvatarFrameEffectID(int id)
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetEffectID(PhantasmPavilionTab.AvatarFrame, id, out int effectID);
|
| | | return effectID;
|
| | | }
|
| | |
|
| | | //获取指定头像底图品质
|
| | | public static int GetAvatarBgColor(int faceID)
|
| | | {
|
| | | int defaultColor = 1;//默认品质是白色
|
| | | int defaultColor = 1;
|
| | | if (!PlayerFaceConfig.HasKey(faceID))
|
| | | return defaultColor;
|
| | | return PlayerFaceConfig.Get(faceID).BgColor;
|
| | |
| | |
|
| | | public static int GetOtherChatBubbleID(int nowID)
|
| | | {
|
| | | return PhantasmPavilionModel.Instance.GetNowOtherChatBubbleID(nowID);
|
| | | return 0;//PhantasmPavilionModel.Instance.GetNowOtherChatBubbleID(nowID);
|
| | | }
|
| | |
|
| | | public static int GetMyChatBubbleID()
|
| | | {
|
| | | return PhantasmPavilionModel.Instance.GetNowChatBubbleID();
|
| | | return 0;//PhantasmPavilionModel.Instance.GetNowChatBubbleID();
|
| | | }
|
| | |
|
| | | public static int GetChatBubbleDefaultID()
|
| | | {
|
| | | PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.ChatBubble, 0, out int defaultID);
|
| | | return defaultID;
|
| | | // PhantasmPavilionModel.Instance.TryGetDefaultID(PhantasmPavilionTab.ChatBubble, 0, out int defaultID);
|
| | | return 0;//defaultID;
|
| | | }
|
| | | } |
| New file |
| | |
| | | // 这个接口定义了所有相关Config类需要提供的公共属性 |
| | | public interface IPhantasmPavilionConfigProperties |
| | | { |
| | | string Name { get; } |
| | | int ExpireMinutes { get; } |
| | | int UnlockWay { get; } |
| | | int UnlockValue { get; } |
| | | int UnlockNeedCnt { get; } |
| | | int UpNeedCnt { get; } |
| | | int StarMax { get; } |
| | | int[] AttrIDList { get; } |
| | | int[] InitAttrValueList { get; } |
| | | int[] AttrPerStarAddList { get; } |
| | | int ResourceType { get; } |
| | | string ResourceValue { get; } |
| | | string GetWayString { get; } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/IPhantasmPavilionHandler.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 2a6fae5b536e8eb41b6573731bddb7ed |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using System.Collections.Generic;
|
| | |
|
| | | public interface IPhantasmPavilionTabHandler
|
| | | public interface IPhantasmPavilionHandler
|
| | | {
|
| | | string GetDescriptive(int id);
|
| | |
|
| | | int GetSortNum(int id);
|
| | |
|
| | | int GetExpireMinutes(int id);
|
| | |
|
| | | string GetImage(int id);
|
| | |
|
| | | bool HasTableKey(int id);
|
| | | List<int> GetKeyList();
|
| | | int GetResourceType(int id);
|
| | | string GetResourceValue(int id);
|
| | | string GetName(int id);
|
| | |
|
| | | List<int> GetTableKeys();
|
| | |
|
| | | int GetUnlockDefault(int id);
|
| | |
|
| | | bool Has(int id);
|
| | |
|
| | |
|
| | | void SendUsePack(int id);
|
| | |
|
| | |
|
| | | bool TryGetEffectID(int id, out int effectID);
|
| | |
|
| | |
|
| | | bool TryGetUnLockAttr(int id, out int[] lightAttrTypeArr, out int[] lightAttrValueArr);
|
| | |
|
| | | bool TryGetUnLockNeedItem(int id, out int itemId, out int count);
|
| | | int GetExpireMinutes(int id);
|
| | | int GetUnlockWay(int id);
|
| | | int GetUnlockValue(int id);
|
| | | int GetUnlockNeedCnt(int id);
|
| | | int GetUpNeedCnt(int id);
|
| | | int GetStarMax(int id);
|
| | | int[] GetAttrIDList(int id);
|
| | | int[] GetInitAttrValueList(int id);
|
| | | int[] GetAttrPerStarAddList(int id);
|
| | | string GetGetWayString(int id);
|
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionAddStarButton : MonoBehaviour |
| | | { |
| | | [SerializeField] ButtonEx btnAddStar; |
| | | [SerializeField] ImageEx imgAddStar; |
| | | [SerializeField] TextEx txtAddStar; |
| | | [SerializeField] ImageEx imgItem; |
| | | [SerializeField] TextEx txtCount; |
| | | [SerializeField] Image imgRed; |
| | | PhantasmPavilionType type; |
| | | int id; |
| | | int unlockWay; |
| | | int unlockValue; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | type = manager.nowType; |
| | | this.id = id; |
| | | btnAddStar.SetListener(() => |
| | | { |
| | | if (unlockWay == 2) |
| | | { |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, unlockValue); |
| | | int useCnt = manager.GetUpNeedCnt(type, id); |
| | | if (useCnt > hasCnt) |
| | | { |
| | | if (!ItemConfig.HasKey(unlockValue)) |
| | | return; |
| | | string name = ItemConfig.Get(unlockValue).ItemName; |
| | | SysNotifyMgr.Instance.ShowTip("UnLockFail2", name); |
| | | return; |
| | | } |
| | | } |
| | | manager.SendOPPack(type, PhantasmPavilionOperation.UpgradeStar, (uint)id); |
| | | }); |
| | | |
| | | unlockWay = manager.GetUnlockWay(type, id); |
| | | unlockValue = manager.GetUnlockValue(type, id); |
| | | |
| | | bool isStarMax = manager.IsStarMax(type, id); |
| | | txtAddStar.text = Language.Get(isStarMax ? "L1110" : "L1109"); |
| | | imgAddStar.gray = isStarMax; |
| | | btnAddStar.interactable = !isStarMax; |
| | | imgRed.SetActive(false); |
| | | txtCount.SetActive(unlockWay == 2 && !isStarMax); |
| | | if (unlockWay == 2) |
| | | { |
| | | if (!ItemConfig.HasKey(unlockValue)) |
| | | return; |
| | | ItemConfig itemConfig = ItemConfig.Get(unlockValue); |
| | | imgItem.SetSprite(itemConfig.IconKey); |
| | | |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, unlockValue); |
| | | int useCnt = manager.GetUpNeedCnt(type, id); |
| | | txtCount.text = UIHelper.AppendColor(useCnt <= hasCnt ? TextColType.Green : TextColType.Red, Language.Get("BoneField09", hasCnt, useCnt)); |
| | | imgRed.SetActive(useCnt <= hasCnt && !isStarMax); |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionAddStarButton.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 7f7449ee889babf4187ff71d8be6c1f0 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionChatBoxCell : MonoBehaviour |
| | | { |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.ChatBox; |
| | | [SerializeField] List<PhantasmPavilionChatBoxItem> items = new List<PhantasmPavilionChatBoxItem>(); |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | int index = rowIndex * rowCountMax + i; |
| | | if (!showItemList.IsNullOrEmpty()) |
| | | { |
| | | if (index < showItemList.Count) |
| | | { |
| | | items[i].SetActive(true); |
| | | items[i].Display(showItemList[index]); |
| | | } |
| | | else |
| | | { |
| | | items[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionChatBoxCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: ca07fe405726ac140970eba578283e6e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class PhantasmPavilionChatBoxHandler : IPhantasmPavilionHandler |
| | | { |
| | | public bool HasTableKey(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.HasKey(id); |
| | | } |
| | | public List<int> GetKeyList() |
| | | { |
| | | return ChatBubbleBoxConfig.GetKeys(); |
| | | } |
| | | public int GetResourceType(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).ResourceType; |
| | | } |
| | | public string GetResourceValue(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).ResourceValue; |
| | | } |
| | | |
| | | public string GetName(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).Name; |
| | | } |
| | | public int GetExpireMinutes(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).ExpireMinutes; |
| | | } |
| | | public int GetUnlockWay(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).UnlockWay; |
| | | } |
| | | public int GetUnlockValue(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).UnlockValue; |
| | | } |
| | | public int GetUnlockNeedCnt(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).UnlockNeedCnt; |
| | | } |
| | | public int GetUpNeedCnt(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).UpNeedCnt; |
| | | } |
| | | public int GetStarMax(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).StarMax; |
| | | } |
| | | public int[] GetAttrIDList(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).AttrIDList; |
| | | } |
| | | public int[] GetInitAttrValueList(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).InitAttrValueList; |
| | | } |
| | | public int[] GetAttrPerStarAddList(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).AttrPerStarAddList; |
| | | } |
| | | public string GetGetWayString(int id) |
| | | { |
| | | return ChatBubbleBoxConfig.Get(id).GetWayString; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionChatBoxItem : MonoBehaviour |
| | | { |
| | | [SerializeField] ImageEx imgBg; |
| | | [SerializeField] ImageEx imgFace; |
| | | [SerializeField] UIFrame uiFrame; |
| | | [SerializeField] UIEffectPlayer spine; |
| | | [SerializeField] Button btnChoose; |
| | | |
| | | [SerializeField] ImageEx imgLimit; |
| | | [SerializeField] ImageEx imgLock; |
| | | [SerializeField] ImageEx imgChoose; |
| | | [SerializeField] ImageEx imgCanUnlock; |
| | | [SerializeField] Image imgUsing; |
| | | [SerializeField] Image imgRed; |
| | | |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.ChatBox; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | this.id = id; |
| | | btnChoose.SetListener(() => |
| | | { |
| | | manager.selectId = id; |
| | | }); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isLimitedTime = manager.IsLimitTime(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | imgChoose.SetActive(manager.selectId == id); |
| | | imgBg.SetSprite(manager.selectId == id ? "ChatBoxSelect" : "ChatBoxUnSelect"); |
| | | imgLimit.SetActive(state == PhantasmPavilionState.Activated && isLimitedTime); |
| | | imgLock.SetActive(state != PhantasmPavilionState.Activated); |
| | | imgCanUnlock.SetActive(state == PhantasmPavilionState.CanActivate); |
| | | imgUsing.SetActive(state == PhantasmPavilionState.Activated && isUsing); |
| | | |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | manager.Show(imgFace, spine, uiFrame, resourceType, resourceValue); |
| | | if (resourceType == 1) |
| | | { |
| | | imgFace.SetNativeSize(); |
| | | } |
| | | |
| | | manager.UpdateItemRedPoint(imgRed, type, id); |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionChatBoxItem.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 6d8dd643a8963624f989e3d1f4022264 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionFaceCell : MonoBehaviour |
| | | { |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Face; |
| | | [SerializeField] List<PhantasmPavilionFaceItem> items = new List<PhantasmPavilionFaceItem>(); |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | int index = rowIndex * rowCountMax + i; |
| | | if (!showItemList.IsNullOrEmpty()) |
| | | { |
| | | if (index < showItemList.Count) |
| | | { |
| | | items[i].SetActive(true); |
| | | items[i].Display(showItemList[index]); |
| | | } |
| | | else |
| | | { |
| | | items[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionFaceCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: e6cbc0f5d8da9394d81c82c48b4dd58c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class PhantasmPavilionFaceHandler : IPhantasmPavilionHandler |
| | | { |
| | | public bool HasTableKey(int id) |
| | | { |
| | | return PlayerFaceConfig.HasKey(id); |
| | | } |
| | | public List<int> GetKeyList() |
| | | { |
| | | return PlayerFaceConfig.GetKeys(); |
| | | } |
| | | public int GetResourceType(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).ResourceType; |
| | | } |
| | | public string GetResourceValue(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).ResourceValue; |
| | | } |
| | | |
| | | public string GetName(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).Name; |
| | | } |
| | | public int GetExpireMinutes(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).ExpireMinutes; |
| | | } |
| | | public int GetUnlockWay(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).UnlockWay; |
| | | } |
| | | public int GetUnlockValue(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).UnlockValue; |
| | | } |
| | | public int GetUnlockNeedCnt(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).UnlockNeedCnt; |
| | | } |
| | | public int GetUpNeedCnt(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).UpNeedCnt; |
| | | } |
| | | public int GetStarMax(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).StarMax; |
| | | } |
| | | public int[] GetAttrIDList(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).AttrIDList; |
| | | } |
| | | public int[] GetInitAttrValueList(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).InitAttrValueList; |
| | | } |
| | | public int[] GetAttrPerStarAddList(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).AttrPerStarAddList; |
| | | } |
| | | public string GetGetWayString(int id) |
| | | { |
| | | return PlayerFaceConfig.Get(id).GetWayString; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionFaceItem : MonoBehaviour |
| | | { |
| | | [SerializeField] EllipseMask mask; |
| | | [SerializeField] ImageEx imgBg; |
| | | [SerializeField] ImageEx imgFace; |
| | | [SerializeField] UIFrame uiFrame; |
| | | [SerializeField] UIEffectPlayer spine; |
| | | [SerializeField] Button btnChoose; |
| | | |
| | | [SerializeField] ImageEx imgLimit; |
| | | [SerializeField] ImageEx imgLock; |
| | | [SerializeField] ImageEx imgChoose; |
| | | [SerializeField] ImageEx imgCanUnlock; |
| | | [SerializeField] TextEx txtUsing; |
| | | [SerializeField] Image imgRed; |
| | | |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Face; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | this.id = id; |
| | | btnChoose.SetListener(() => |
| | | { |
| | | manager.selectId = id; |
| | | }); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isLimitedTime = manager.IsLimitTime(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | imgChoose.SetActive(manager.selectId == id); |
| | | imgLimit.SetActive(state == PhantasmPavilionState.Activated && isLimitedTime); |
| | | imgLock.SetActive(state != PhantasmPavilionState.Activated); |
| | | imgCanUnlock.SetActive(state == PhantasmPavilionState.CanActivate); |
| | | txtUsing.SetActive(state == PhantasmPavilionState.Activated && isUsing); |
| | | |
| | | string str = AvatarHelper.GetAvatarBgColorStr(id); |
| | | imgBg.SetSprite(str); |
| | | manager.ShowFace(imgFace, spine, uiFrame, mask, id); |
| | | |
| | | manager.UpdateItemRedPoint(imgRed, type, id); |
| | | |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionFaceItem.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: dda542d2b8148544fb2a89824c2c943b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionFacePicCell : MonoBehaviour |
| | | { |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.FacePic; |
| | | [SerializeField] List<PhantasmPavilionFacePicItem> items = new List<PhantasmPavilionFacePicItem>(); |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int rowIndex) |
| | | { |
| | | |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | int index = rowIndex * rowCountMax + i; |
| | | if (!showItemList.IsNullOrEmpty()) |
| | | { |
| | | if (index < showItemList.Count) |
| | | { |
| | | items[i].SetActive(true); |
| | | items[i].Display(showItemList[index]); |
| | | } |
| | | else |
| | | { |
| | | items[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionFacePicCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 47af8fe5da030e14181647ac6423f4a2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class PhantasmPavilionFacePicHandler : IPhantasmPavilionHandler |
| | | { |
| | | |
| | | public bool HasTableKey(int id) |
| | | { |
| | | return PlayerFacePicConfig.HasKey(id); |
| | | } |
| | | public List<int> GetKeyList() |
| | | { |
| | | return PlayerFacePicConfig.GetKeys(); |
| | | } |
| | | public int GetResourceType(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).ResourceType; |
| | | } |
| | | public string GetResourceValue(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).ResourceValue; |
| | | } |
| | | |
| | | public string GetName(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).Name; |
| | | } |
| | | public int GetExpireMinutes(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).ExpireMinutes; |
| | | } |
| | | public int GetUnlockWay(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).UnlockWay; |
| | | } |
| | | public int GetUnlockValue(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).UnlockValue; |
| | | } |
| | | public int GetUnlockNeedCnt(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).UnlockNeedCnt; |
| | | } |
| | | public int GetUpNeedCnt(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).UpNeedCnt; |
| | | } |
| | | public int GetStarMax(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).StarMax; |
| | | } |
| | | public int[] GetAttrIDList(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).AttrIDList; |
| | | } |
| | | public int[] GetInitAttrValueList(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).InitAttrValueList; |
| | | } |
| | | public int[] GetAttrPerStarAddList(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).AttrPerStarAddList; |
| | | } |
| | | public string GetGetWayString(int id) |
| | | { |
| | | return PlayerFacePicConfig.Get(id).GetWayString; |
| | | } |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionFacePicItem : MonoBehaviour |
| | | { |
| | | [SerializeField] ImageEx imgFace; |
| | | [SerializeField] UIFrame uiFrame; |
| | | [SerializeField] UIEffectPlayer spine; |
| | | [SerializeField] Button btnChoose; |
| | | |
| | | [SerializeField] ImageEx imgLimit; |
| | | [SerializeField] ImageEx imgLock; |
| | | [SerializeField] ImageEx imgChoose; |
| | | [SerializeField] ImageEx imgCanUnlock; |
| | | [SerializeField] TextEx txtUsing; |
| | | [SerializeField] Image imgRed; |
| | | |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.FacePic; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | this.id = id; |
| | | btnChoose.SetListener(() => |
| | | { |
| | | manager.selectId = id; |
| | | }); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isLimitedTime = manager.IsLimitTime(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | imgChoose.SetActive(manager.selectId == id); |
| | | imgLimit.SetActive(state == PhantasmPavilionState.Activated && isLimitedTime); |
| | | imgLock.SetActive(state != PhantasmPavilionState.Activated); |
| | | imgCanUnlock.SetActive(state == PhantasmPavilionState.CanActivate); |
| | | txtUsing.SetActive(state == PhantasmPavilionState.Activated && isUsing); |
| | | |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | manager.Show(imgFace, spine, uiFrame, resourceType, resourceValue); |
| | | |
| | | manager.UpdateItemRedPoint(imgRed, type, id); |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionFacePicItem.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 4a3d2c189d477724b8b31431f12ffae3 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionFaceWin : UIBase |
| | | { |
| | | [SerializeField] ButtonEx btnAllAdd; |
| | | [Header("二级标签页")] |
| | | [SerializeField] GroupButtonEx btnFace; |
| | | [SerializeField] GroupButtonEx btnFacePic; |
| | | [SerializeField] GroupButtonEx btnChatBox; |
| | | |
| | | [Header("选中项展示")] |
| | | [SerializeField] Transform transNowFace; |
| | | [SerializeField] Transform transNowFacePic; |
| | | [SerializeField] Transform transNowChatBox; |
| | | // 当前头像 |
| | | [SerializeField] EllipseMask maskNowFace; |
| | | [SerializeField] ImageEx imgNowFaceBg; |
| | | [SerializeField] ImageEx imgNowFace; |
| | | [SerializeField] UIFrame uiFrameNowFace; |
| | | [SerializeField] UIEffectPlayer effectPlayerNowFace; |
| | | // 当前头像框 |
| | | |
| | | [SerializeField] ImageEx imgNowFacePicFaceBg; |
| | | [SerializeField] EllipseMask maskNowFacePicFace; |
| | | [SerializeField] ImageEx imgNowFacePicFace; |
| | | [SerializeField] UIFrame uiFrameNowFacePicFace; |
| | | [SerializeField] UIEffectPlayer UIEffectPlayerNowFacePicFace; |
| | | |
| | | [SerializeField] ImageEx imgNowFacePic; |
| | | [SerializeField] UIFrame uiFrameNowFacePic; |
| | | [SerializeField] UIEffectPlayer UIEffectPlayerNowFacePic; |
| | | |
| | | //当前气泡 |
| | | [SerializeField] ImageEx imgNowChatBox; |
| | | [SerializeField] UIFrame uiFrameNowChatBox; |
| | | [SerializeField] UIEffectPlayer UIEffectPlayerNowChatBox; |
| | | |
| | | |
| | | [Header("属性展示")] |
| | | [SerializeField] TextEx txtName; |
| | | [SerializeField] TextEx txtGetWayString; |
| | | [SerializeField] TextEx txtAddInfo; |
| | | [SerializeField] TextEx txtUnLockInfo; |
| | | [SerializeField] TextEx txtNoInfo; |
| | | [SerializeField] ScrollerController scrInfo; |
| | | |
| | | [Header("滚动列表")] |
| | | [SerializeField] ScrollerController scrFace; |
| | | [SerializeField] ScrollerController scrFacePic; |
| | | [SerializeField] ScrollerController scrChatBox; |
| | | |
| | | [Header("按钮")] |
| | | [SerializeField] PhantasmPavilionUnlockButton btnUnlock; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn1; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn2; |
| | | [SerializeField] PhantasmPavilionAddStarButton btnAddStar; |
| | | |
| | | [SerializeField] TextEx txtRemainingTime1; |
| | | [SerializeField] TextEx txtRemainingTime2; |
| | | |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | btnFace.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.Face); }); |
| | | btnFacePic.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.FacePic); }); |
| | | btnChatBox.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.ChatBox); }); |
| | | btnAllAdd.AddListener(() => { AttributeManager.Instance.OpenTotalAttributeWin(manager.GetTotalAttr()); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | scrInfo.OnRefreshCell += OnRefreshInfoCell; |
| | | scrFace.OnRefreshCell += OnRefreshFaceCell; |
| | | scrFacePic.OnRefreshCell += OnRefreshFacePicCell; |
| | | scrChatBox.OnRefreshCell += OnRefreshChatBoxCell; |
| | | manager.OnSelectItemIdChange += OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateChatBoxInfoEvent += OnUpdateChatBoxInfoEvent; |
| | | manager.OnUpdateFaceInfoEvent += OnUpdateFaceInfoEvent; |
| | | manager.OnUpdateFacePicInfo += OnUpdateFacePicInfo; |
| | | manager.OnTimeOut += OnTimeOut; |
| | | InitRedPoint(); |
| | | SelectTiltleBtn(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | scrInfo.OnRefreshCell -= OnRefreshInfoCell; |
| | | scrFace.OnRefreshCell -= OnRefreshFaceCell; |
| | | scrFacePic.OnRefreshCell -= OnRefreshFacePicCell; |
| | | scrChatBox.OnRefreshCell -= OnRefreshChatBoxCell; |
| | | manager.OnSelectItemIdChange -= OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateChatBoxInfoEvent -= OnUpdateChatBoxInfoEvent; |
| | | manager.OnUpdateFaceInfoEvent -= OnUpdateFaceInfoEvent; |
| | | manager.OnUpdateFacePicInfo -= OnUpdateFacePicInfo; |
| | | manager.OnTimeOut -= OnTimeOut; |
| | | } |
| | | |
| | | private void OnTimeOut() |
| | | { |
| | | RefreshAll(manager.nowType); |
| | | } |
| | | |
| | | private void OnUpdateFacePicInfo() |
| | | { |
| | | RefreshAll(manager.nowType); |
| | | } |
| | | private void OnUpdateFaceInfoEvent() |
| | | { |
| | | RefreshAll(manager.nowType); |
| | | } |
| | | |
| | | private void OnUpdateChatBoxInfoEvent() |
| | | { |
| | | RefreshAll(manager.nowType); |
| | | } |
| | | |
| | | void InitRedPoint() |
| | | { |
| | | btnFace.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.FaceAvatar); |
| | | btnFacePic.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.FaceFrame); |
| | | btnChatBox.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.FaceBubble); |
| | | } |
| | | |
| | | void SelectTiltleBtn() |
| | | { |
| | | if (functionOrder == 0) |
| | | { |
| | | btnFace.SelectBtn(); |
| | | SelectTeamFunc(PhantasmPavilionType.Face); |
| | | } |
| | | else if (functionOrder == 1) |
| | | { |
| | | btnFacePic.SelectBtn(); |
| | | SelectTeamFunc(PhantasmPavilionType.FacePic); |
| | | } |
| | | else if (functionOrder == 2) |
| | | { |
| | | btnChatBox.SelectBtn(); |
| | | SelectTeamFunc(PhantasmPavilionType.ChatBox); |
| | | } |
| | | } |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type) |
| | | { |
| | | manager.SetSelectItemId(type); |
| | | manager.nowType = type; |
| | | CreateAll(type); |
| | | } |
| | | |
| | | private void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | switch (type) |
| | | { |
| | | case PlayerDataType.Face: |
| | | case PlayerDataType.FacePic: |
| | | case PlayerDataType.ExAttr10: |
| | | RefreshAll(manager.nowType, false); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | bool isLimitedTime = manager.IsLimitTime(manager.nowType, manager.selectId); |
| | | if (isLimitedTime) |
| | | { |
| | | UpdateTimer(manager.nowType, manager.selectId); |
| | | } |
| | | } |
| | | |
| | | private void OnRefreshItemEvent(PackType type, int arg2, int arg3) |
| | | { |
| | | if (type != PackType.Item) |
| | | return; |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | } |
| | | |
| | | private void OnSelectItemIdChange(int id) |
| | | { |
| | | RefreshAll(manager.nowType, false); |
| | | } |
| | | |
| | | private void RefreshAll(PhantasmPavilionType type, bool isJump = true) |
| | | { |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Face: |
| | | scrFace.m_Scorller.RefreshActiveCellViews(); |
| | | if (isJump) |
| | | { |
| | | scrFace.JumpIndex(manager.GetJumpIndex(type)); |
| | | } |
| | | break; |
| | | case PhantasmPavilionType.FacePic: |
| | | scrFacePic.m_Scorller.RefreshActiveCellViews(); |
| | | if (isJump) |
| | | { |
| | | scrFacePic.JumpIndex(manager.GetJumpIndex(type)); |
| | | } |
| | | break; |
| | | case PhantasmPavilionType.ChatBox: |
| | | scrChatBox.m_Scorller.RefreshActiveCellViews(); |
| | | if (isJump) |
| | | { |
| | | scrChatBox.JumpIndex(manager.GetJumpIndex(type)); |
| | | } |
| | | break; |
| | | } |
| | | CreateInfoScroller(); |
| | | DisplayButton(type, manager.selectId); |
| | | DisplayInfo(type, manager.selectId); |
| | | } |
| | | |
| | | void CreateAll(PhantasmPavilionType type) |
| | | { |
| | | transNowFace.SetActive(type == PhantasmPavilionType.Face); |
| | | transNowFacePic.SetActive(type == PhantasmPavilionType.FacePic); |
| | | transNowChatBox.SetActive(type == PhantasmPavilionType.ChatBox); |
| | | |
| | | scrFace.SetActive(type == PhantasmPavilionType.Face); |
| | | scrFacePic.SetActive(type == PhantasmPavilionType.FacePic); |
| | | scrChatBox.SetActive(type == PhantasmPavilionType.ChatBox); |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Face: |
| | | CreateFaceScroller(); |
| | | break; |
| | | case PhantasmPavilionType.FacePic: |
| | | CreateFacePicScroller(); |
| | | break; |
| | | case PhantasmPavilionType.ChatBox: |
| | | CreateChatBoxScroller(); |
| | | break; |
| | | } |
| | | CreateInfoScroller(); |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | DisplayInfo(manager.nowType, manager.selectId); |
| | | } |
| | | private void OnRefreshInfoCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionInfoCell>(); |
| | | _cell?.Display(cell.index, cell); |
| | | } |
| | | |
| | | private void OnRefreshFaceCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionFaceCell>(); |
| | | _cell?.Display(cell.index); |
| | | } |
| | | |
| | | private void OnRefreshFacePicCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionFacePicCell>(); |
| | | _cell?.Display(cell.index); |
| | | } |
| | | |
| | | private void OnRefreshChatBoxCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionChatBoxCell>(); |
| | | _cell?.Display(cell.index); |
| | | } |
| | | |
| | | public void DisplayInfo(PhantasmPavilionType type, int id) |
| | | { |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | string str = AvatarHelper.GetAvatarBgColorStr(id); |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Face: |
| | | manager.ShowFace(imgNowFace, effectPlayerNowFace, uiFrameNowFace, maskNowFace, id); |
| | | imgNowFaceBg.SetSprite(str); |
| | | if (resourceType == 1) |
| | | { |
| | | imgNowFace.SetNativeSize(); |
| | | } |
| | | break; |
| | | case PhantasmPavilionType.FacePic: |
| | | if (!manager.TryGetNowShowID(PhantasmPavilionType.Face, out int faceID)) |
| | | return; |
| | | manager.ShowFace(imgNowFacePicFace, UIEffectPlayerNowFacePicFace, uiFrameNowFacePicFace, maskNowFacePicFace, faceID); |
| | | str = AvatarHelper.GetAvatarBgColorStr(faceID); |
| | | imgNowFacePicFaceBg.SetSprite(str); |
| | | manager.Show(imgNowFacePic, UIEffectPlayerNowFacePic, uiFrameNowFacePic, resourceType, resourceValue); |
| | | if (resourceType == 1) |
| | | { |
| | | imgNowFacePicFace.SetNativeSize(); |
| | | imgNowFacePic.SetNativeSize(); |
| | | } |
| | | |
| | | break; |
| | | case PhantasmPavilionType.ChatBox: |
| | | manager.Show(imgNowChatBox, UIEffectPlayerNowChatBox, uiFrameNowChatBox, resourceType, resourceValue); |
| | | if (resourceType == 1) |
| | | { |
| | | imgNowChatBox.SetNativeSize(); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | txtName.text = manager.GetName(type, id); |
| | | txtGetWayString.text = Language.Get("PhantasmPavilion06", manager.GetGetWayString(type, id)); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isHasAttr = manager.HasInitAttr(type, id); // 是否有解锁属性 |
| | | txtAddInfo.SetActive(state == PhantasmPavilionState.Activated); |
| | | txtUnLockInfo.SetActive(state != PhantasmPavilionState.Activated); |
| | | txtNoInfo.SetActive(!isHasAttr); |
| | | CreateInfoScroller(); |
| | | } |
| | | |
| | | public void DisplayButton(PhantasmPavilionType type, int id) |
| | | { |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | |
| | | btnUnlock.SetActive(state != PhantasmPavilionState.Activated); |
| | | btnAddStar.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd); |
| | | btnPutOn1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd); |
| | | btnPutOn2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd); |
| | | |
| | | btnUnlock.Display(id); |
| | | btnAddStar.Display(id); |
| | | btnPutOn1.Display(id); |
| | | btnPutOn2.Display(id); |
| | | |
| | | |
| | | UpdateTimer(type, id); |
| | | } |
| | | |
| | | private void CreateInfoScroller() |
| | | { |
| | | PhantasmPavilionType type = manager.nowType; |
| | | int id = manager.selectId; |
| | | if (!manager.Has(type, id)) |
| | | return; |
| | | scrInfo.Refresh(); |
| | | int[] attrIDList = manager.GetAttrIDList(type, id); |
| | | int[] initAttrValueList = manager.GetInitAttrValueList(type, id); |
| | | if (!attrIDList.IsNullOrEmpty() && !initAttrValueList.IsNullOrEmpty() && attrIDList.Length == initAttrValueList.Length) |
| | | { |
| | | for (int i = 0; i < attrIDList.Length; i++) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = id; |
| | | scrInfo.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | scrInfo.Restart(); |
| | | } |
| | | |
| | | private void CreateFaceScroller() |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.Face; |
| | | scrFace.Refresh(); |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (!showItemList.IsNullOrEmpty() && manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | { |
| | | int rowCount = (int)Math.Ceiling((double)showItemList.Count / rowCountMax); |
| | | for (int i = 0; i < rowCount; i++) |
| | | { |
| | | scrFace.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scrFace.Restart(); |
| | | |
| | | int jumpIndex = manager.GetJumpIndex(type); |
| | | scrFace.JumpIndex(jumpIndex); |
| | | } |
| | | |
| | | private void CreateFacePicScroller() |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.FacePic; |
| | | scrFacePic.Refresh(); |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (!showItemList.IsNullOrEmpty() && manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | { |
| | | int rowCount = (int)Math.Ceiling((double)showItemList.Count / rowCountMax); |
| | | for (int i = 0; i < rowCount; i++) |
| | | { |
| | | scrFacePic.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scrFacePic.Restart(); |
| | | |
| | | int jumpIndex = manager.GetJumpIndex(type); |
| | | scrFacePic.JumpIndex(jumpIndex); |
| | | } |
| | | |
| | | private void CreateChatBoxScroller() |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.ChatBox; |
| | | scrChatBox.Refresh(); |
| | | List<int> showItemList = manager.ShowItemList(type); |
| | | if (!showItemList.IsNullOrEmpty() && manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | { |
| | | int rowCount = (int)Math.Ceiling((double)showItemList.Count / rowCountMax); |
| | | for (int i = 0; i < rowCount; i++) |
| | | { |
| | | scrChatBox.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | } |
| | | scrChatBox.Restart(); |
| | | |
| | | int jumpIndex = manager.GetJumpIndex(type); |
| | | scrChatBox.JumpIndex(jumpIndex); |
| | | } |
| | | |
| | | public void UpdateTimer(PhantasmPavilionType type, int id) |
| | | { |
| | | bool isUnlock = manager.IsUnlock(type, id); |
| | | bool isLimitTime = manager.IsLimitTime(type, id); |
| | | if (!isUnlock || !isLimitTime || !manager.TryGetInfo(type, id, out var info) || info.EndTime <= 0) |
| | | { |
| | | txtRemainingTime1.SetActive(false); |
| | | txtRemainingTime2.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | |
| | | DateTime endDateTime = TimeUtility.OriginalTime.AddSeconds(info.EndTime); |
| | | TimeSpan remainingTime = endDateTime - TimeUtility.ServerNow; |
| | | int remainingSeconds = (int)remainingTime.TotalSeconds; |
| | | txtRemainingTime1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && remainingSeconds > 0); |
| | | txtRemainingTime2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && remainingSeconds > 0); |
| | | if (remainingSeconds > 0) |
| | | { |
| | | string countdownText = TimeUtility.SecondsToShortDHMS(remainingSeconds); |
| | | txtRemainingTime1.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | txtRemainingTime2.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionFaceWin.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 822ea055abfe5aa4c801bf8dd200cb8e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionInfoCell : MonoBehaviour |
| | | { |
| | | [SerializeField] TextEx txtUnLockInfo; |
| | | [SerializeField] TextEx txtAddInfo; |
| | | [SerializeField] TextEx txtAddNext; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int index, CellView cellView) |
| | | { |
| | | int id = cellView.info.Value.infoInt1; |
| | | PhantasmPavilionType type = manager.nowType; |
| | | int[] attrIDList = manager.GetAttrIDList(type, id); |
| | | int[] initAttrValueList = manager.GetInitAttrValueList(type, id); |
| | | if (attrIDList.IsNullOrEmpty() || initAttrValueList.IsNullOrEmpty() |
| | | || attrIDList.Length != initAttrValueList.Length || attrIDList.Length <= index) |
| | | { |
| | | txtUnLockInfo.SetActive(false); |
| | | txtAddInfo.SetActive(false); |
| | | txtAddNext.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | int attrID = attrIDList[index]; |
| | | int attrValue = initAttrValueList[index]; |
| | | bool isHasAttr = manager.HasInitAttr(type, id); // 是否有解锁属性 |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); // 是否可升星 |
| | | bool isStarMax = manager.IsStarMax(type, id); // 是否已升满 |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | txtUnLockInfo.SetActive(state != PhantasmPavilionState.Activated || (state == PhantasmPavilionState.Activated && isHasAttr && !isCanStarAdd)); |
| | | txtAddInfo.SetActive(state == PhantasmPavilionState.Activated && isHasAttr && isCanStarAdd); |
| | | txtAddNext.SetActive(state == PhantasmPavilionState.Activated && isHasAttr && isCanStarAdd && !isStarMax); |
| | | if (isHasAttr) |
| | | { |
| | | txtUnLockInfo.text = PlayerPropertyConfig.GetFullDescription(attrID, attrValue); |
| | | } |
| | | |
| | | if (isCanStarAdd) |
| | | { |
| | | int addValue = manager.GetEndAttrValue(type, id, index); |
| | | txtAddInfo.text = PlayerPropertyConfig.GetFullDescription(attrID, addValue); |
| | | } |
| | | |
| | | if (isCanStarAdd && !isStarMax) |
| | | { |
| | | int[] attrPerStarAddList = manager.GetAttrPerStarAddList(type, id); |
| | | if (attrPerStarAddList.IsNullOrEmpty() || attrIDList.Length != initAttrValueList.Length || attrPerStarAddList.Length <= index) |
| | | return; |
| | | int attrPerStarAdd = attrPerStarAddList[index]; |
| | | txtAddNext.text = Language.Get("PhantasmPavilion12", UIHelper.AppendColor(TextColType.LightGreen, StringUtility.Contact("+", PlayerPropertyConfig.GetValueDescription(attrID, attrPerStarAdd)))); |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionInfoCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 9c67fd8c3ac120b4f9d5b9532aee635c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | // 属性计算相关 |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | public Dictionary<int, long> attrDic = new Dictionary<int, long>(); |
| | | |
| | | public Dictionary<int, long> GetTotalAttr() |
| | | { |
| | | return attrDic; |
| | | } |
| | | |
| | | public long GetAttrValue(int attrID) |
| | | { |
| | | attrDic.TryGetValue(attrID, out long value); |
| | | return value; |
| | | } |
| | | |
| | | public int GetAttrPer(int attrID) |
| | | { |
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrID)) |
| | | { |
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrID]; |
| | | attrDic.TryGetValue(pertype, out long value); |
| | | return (int)(value); |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | public void RefreshAttr() |
| | | { |
| | | attrDic.Clear(); |
| | | |
| | | foreach (string name in Enum.GetNames(typeof(PhantasmPavilionType))) |
| | | { |
| | | PhantasmPavilionType type = (PhantasmPavilionType)Enum.Parse(typeof(PhantasmPavilionType), name); |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | continue; |
| | | var list = handler.GetKeyList(); |
| | | if (list.IsNullOrEmpty()) |
| | | continue; |
| | | foreach (var id in list) |
| | | { |
| | | bool hasInitAttr = HasInitAttr(type, id); |
| | | bool hasStarAddAttr = HasStarAddAttr(type, id); |
| | | // 有初始属性 |
| | | if (hasInitAttr && !hasStarAddAttr) |
| | | { |
| | | int[] attrIDList = GetAttrIDList(type, id); |
| | | // 不支持升星 |
| | | if (!hasStarAddAttr) |
| | | { |
| | | int[] initAttrValueList = GetInitAttrValueList(type, id); |
| | | for (int i = 0; i < attrIDList.Length; i++) |
| | | { |
| | | if (!attrDic.ContainsKey(attrIDList[i])) |
| | | { |
| | | attrDic[attrIDList[i]] = 0; |
| | | } |
| | | // 解锁的才累加计算属性 |
| | | bool isUnlock = IsUnlock(type, id); |
| | | if (!isUnlock) |
| | | continue; |
| | | attrDic[attrIDList[i]] += initAttrValueList[i]; |
| | | } |
| | | } |
| | | // 支持升星 |
| | | else |
| | | { |
| | | |
| | | for (int i = 0; i < attrIDList.Length; i++) |
| | | { |
| | | if (!attrDic.ContainsKey(attrIDList[i])) |
| | | { |
| | | attrDic[attrIDList[i]] = 0; |
| | | } |
| | | |
| | | // 解锁的才累加计算属性 |
| | | bool isUnlock = IsUnlock(type, id); |
| | | if (!isUnlock) |
| | | continue; |
| | | |
| | | int addValue = GetEndAttrValue(type, id, i); |
| | | attrDic[attrIDList[i]] += addValue; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //最终属性 = 初始属性 + 星级*升星加成值 |
| | | public int GetEndAttrValue(PhantasmPavilionType type, int id, int AttrIndex) |
| | | { |
| | | bool isCanStarAdd = HasStarAddAttr(type, id); // 是否可升星 |
| | | if (!isCanStarAdd || !TryGetInfo(type, id, out PhantasmPavilionData info)) |
| | | return 0; |
| | | int[] attrIDList = GetAttrIDList(type, id); |
| | | int[] initAttrValueList = GetInitAttrValueList(type, id); |
| | | int[] attrPerStarAddList = GetAttrPerStarAddList(type, id); |
| | | if (attrIDList.IsNullOrEmpty() || initAttrValueList.IsNullOrEmpty() || attrPerStarAddList.IsNullOrEmpty() || |
| | | attrIDList.Length != initAttrValueList.Length || attrIDList.Length != attrPerStarAddList.Length || |
| | | attrIDList.Length <= AttrIndex) |
| | | return 0; |
| | | int initAttrValue = initAttrValueList[AttrIndex]; |
| | | int attrPerStarAdd = attrPerStarAddList[AttrIndex]; |
| | | return initAttrValue + info.Star * attrPerStarAdd; |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionManager.Attr.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: e244948b4dd758f44803a70bf221746c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | // 默认ID相关 |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | //<类型,<job,id>> |
| | | public Dictionary<PhantasmPavilionType, Dictionary<int, int>> defaultIDDict = new Dictionary<PhantasmPavilionType, Dictionary<int, int>>(); |
| | | //<类型,id> |
| | | public Dictionary<PhantasmPavilionType, int> nowIDDict = new Dictionary<PhantasmPavilionType, int>(); |
| | | void InitTable() |
| | | { |
| | | var tabValues = Enum.GetValues(typeof(PhantasmPavilionType)); |
| | | for (int i = 0; i < tabValues.Length; i++) |
| | | { |
| | | PhantasmPavilionType tab = (PhantasmPavilionType)tabValues.GetValue(i); |
| | | if (!defaultIDDict.ContainsKey(tab)) |
| | | { |
| | | defaultIDDict[tab] = new Dictionary<int, int>(); |
| | | } |
| | | } |
| | | var config = FuncConfigConfig.Get("PhantasmPavilion"); |
| | | defaultIDDict[PhantasmPavilionType.Face] = ConfigParse.ParseIntDict(config.Numerical1); |
| | | defaultIDDict[PhantasmPavilionType.FacePic] = ConfigParse.ParseIntDict(config.Numerical2); |
| | | defaultIDDict[PhantasmPavilionType.ChatBox] = ConfigParse.ParseIntDict(config.Numerical3); |
| | | defaultIDDict[PhantasmPavilionType.Model] = ConfigParse.ParseIntDict(config.Numerical4); |
| | | //PhantasmPavilionType.Title 支持卸下,不需要保底的默认值 |
| | | } |
| | | |
| | | void InitNowIDDict() |
| | | { |
| | | nowIDDict[PhantasmPavilionType.Face] = PlayerDatas.Instance.baseData.face; |
| | | nowIDDict[PhantasmPavilionType.FacePic] = PlayerDatas.Instance.baseData.facePic; |
| | | nowIDDict[PhantasmPavilionType.ChatBox] = (int)PlayerDatas.Instance.baseData.chatBox; |
| | | nowIDDict[PhantasmPavilionType.Model] = PlayerDatas.Instance.baseData.modelMark; |
| | | nowIDDict[PhantasmPavilionType.Title] = PlayerDatas.Instance.baseData.TitleID; |
| | | } |
| | | |
| | | void UpdateNowIDDict(PlayerDataType type) |
| | | { |
| | | bool isUpdate = true; |
| | | PhantasmPavilionType phantasmPavilionType = PhantasmPavilionType.Face; |
| | | switch (type) |
| | | { |
| | | case PlayerDataType.Face: |
| | | phantasmPavilionType = PhantasmPavilionType.Face; |
| | | nowIDDict[phantasmPavilionType] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.Face); |
| | | break; |
| | | case PlayerDataType.FacePic: |
| | | phantasmPavilionType = PhantasmPavilionType.FacePic; |
| | | nowIDDict[phantasmPavilionType] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FacePic); |
| | | break; |
| | | case PlayerDataType.ExAttr10: |
| | | phantasmPavilionType = PhantasmPavilionType.ChatBox; |
| | | nowIDDict[phantasmPavilionType] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr10); |
| | | break; |
| | | case PlayerDataType.ModelMark: |
| | | phantasmPavilionType = PhantasmPavilionType.Model; |
| | | nowIDDict[phantasmPavilionType] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ModelMark); |
| | | break; |
| | | case PlayerDataType.ExAttr3: |
| | | phantasmPavilionType = PhantasmPavilionType.Title; |
| | | nowIDDict[phantasmPavilionType] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.ExAttr3); |
| | | break; |
| | | default: |
| | | isUpdate = false; |
| | | break; |
| | | } |
| | | |
| | | if (isUpdate) |
| | | { |
| | | if (nowType == phantasmPavilionType) |
| | | { |
| | | if (TryGetNowShowID(phantasmPavilionType, out int showID)) |
| | | { |
| | | selectId = showID; |
| | | } |
| | | |
| | | } |
| | | UpdateRedPoint(); |
| | | } |
| | | } |
| | | |
| | | //获取不同职业对应的ID默认值 |
| | | public bool TryGetDefaultID(PhantasmPavilionType type, int job, out int defaultID) |
| | | { |
| | | defaultID = 0; |
| | | if (defaultIDDict == null || !defaultIDDict.TryGetValue(type, out var dict) || dict == null) |
| | | return false; |
| | | return dict.TryGetValue(job, out defaultID) || dict.TryGetValue(0, out defaultID); |
| | | } |
| | | |
| | | // 获取当前应该显示的ID |
| | | public bool TryGetNowShowID(PhantasmPavilionType type, out int showID) |
| | | { |
| | | showID = 0; |
| | | int job = PlayerDatas.Instance.baseData.Job; |
| | | |
| | | if (type != PhantasmPavilionType.Title) |
| | | { |
| | | if (!TryGetDefaultID(type, job, out int defaultID)) |
| | | return false; |
| | | |
| | | // 尝试获取玩家当前佩戴的ID |
| | | bool hasEquippedID = nowIDDict.TryGetValue(type, out int equippedID); |
| | | // 检查当前佩戴的ID是否有效 |
| | | bool isEquippedIDValid = hasEquippedID && IsUnlock(type, equippedID); |
| | | // 如果佩戴的ID有效,则使用它;否则,回退到之前获取的默认ID |
| | | showID = isEquippedIDValid ? equippedID : defaultID; |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | // 尝试获取玩家当前佩戴的ID |
| | | bool hasEquippedID = nowIDDict.TryGetValue(type, out int equippedID); |
| | | // 检查当前佩戴的ID是否有效 |
| | | bool isEquippedIDValid = hasEquippedID && IsUnlock(type, equippedID); |
| | | // 如果佩戴的ID有效,则使用它;否则,返回0 |
| | | showID = isEquippedIDValid ? equippedID : 0; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| File was renamed from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 21fc13d90db03874e9b475fa46e4aefc |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | // 通用的读config方法 |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | public bool Has(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return false; |
| | | return handler.HasTableKey(id); |
| | | } |
| | | public List<int> GetTableKeys(PhantasmPavilionType type) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return new List<int>(); |
| | | return handler.GetKeyList(); |
| | | } |
| | | public string GetName(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return string.Empty; |
| | | if (!Has(type, id)) |
| | | return string.Empty; |
| | | return handler.GetName(id); |
| | | } |
| | | public int GetExpireMinutes(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetExpireMinutes(id); |
| | | } |
| | | |
| | | public int GetUnlockWay(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetUnlockWay(id); |
| | | } |
| | | |
| | | public int GetUnlockValue(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetUnlockValue(id); |
| | | } |
| | | |
| | | public int GetUnlockNeedCnt(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetUnlockNeedCnt(id); |
| | | } |
| | | |
| | | public int GetUpNeedCnt(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetUpNeedCnt(id); |
| | | } |
| | | public int GetStarMax(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetStarMax(id); |
| | | } |
| | | |
| | | public int[] GetAttrIDList(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return null; |
| | | if (!Has(type, id)) |
| | | return null; |
| | | return handler.GetAttrIDList(id); |
| | | } |
| | | public int[] GetInitAttrValueList(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return null; |
| | | if (!Has(type, id)) |
| | | return null; |
| | | return handler.GetInitAttrValueList(id); |
| | | } |
| | | |
| | | public int[] GetAttrPerStarAddList(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return null; |
| | | if (!Has(type, id)) |
| | | return null; |
| | | return handler.GetAttrPerStarAddList(id); |
| | | } |
| | | |
| | | public int GetResourceType(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return 0; |
| | | if (!Has(type, id)) |
| | | return 0; |
| | | return handler.GetResourceType(id); |
| | | } |
| | | |
| | | public string GetResourceValue(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return string.Empty; |
| | | if (!Has(type, id)) |
| | | return string.Empty; |
| | | return handler.GetResourceValue(id); |
| | | } |
| | | |
| | | public string GetGetWayString(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!TryGetHandlerValue(type, out var handler)) |
| | | return string.Empty; |
| | | if (!Has(type, id)) |
| | | return string.Empty; |
| | | return handler.GetGetWayString(id); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionManager.LoadConfig.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 37106de00e81c334c85b15934744d20b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | readonly public Dictionary<PhantasmPavilionType, IPhantasmPavilionHandler> handlers = new Dictionary<PhantasmPavilionType, IPhantasmPavilionHandler>() |
| | | { |
| | | { PhantasmPavilionType.Face, new PhantasmPavilionFaceHandler() }, |
| | | { PhantasmPavilionType.FacePic, new PhantasmPavilionFacePicHandler() }, |
| | | { PhantasmPavilionType.ChatBox, new PhantasmPavilionChatBoxHandler() }, |
| | | { PhantasmPavilionType.Title, new PhantasmPavilionTitleHandler() }, |
| | | { PhantasmPavilionType.Model, new PhantasmPavilionModelHandler() }, |
| | | }; |
| | | public bool TryGetHandlerValue(PhantasmPavilionType type, out IPhantasmPavilionHandler handler) |
| | | { |
| | | return handlers.TryGetValue(type, out handler); |
| | | } |
| | | |
| | | // 一行展示x个物品 |
| | | public readonly Dictionary<PhantasmPavilionType, int> rowCountMaxDict = new Dictionary<PhantasmPavilionType, int>() |
| | | { |
| | | {PhantasmPavilionType.Face, 4}, |
| | | {PhantasmPavilionType.FacePic, 4}, |
| | | {PhantasmPavilionType.ChatBox, 3}, |
| | | {PhantasmPavilionType.Title, 3}, |
| | | {PhantasmPavilionType.Model, 5}, |
| | | }; |
| | | |
| | | public bool TryGetRowCountMax(PhantasmPavilionType type, out int rowCountMax) |
| | | { |
| | | return rowCountMaxDict.TryGetValue(type, out rowCountMax); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionManager.ReadOnly.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 58fd21664f7fe9e439b4d81e1ca57218 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine.UI; |
| | | |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | public Redpoint parentRedpoint = new Redpoint(MainRedDot.MainAffairsRedpoint, MainRedDot.PhantasmPavilionRepoint); |
| | | public Dictionary<PhantasmPavilionRepointType, Redpoint> tabRedPointDict = new Dictionary<PhantasmPavilionRepointType, Redpoint>(); |
| | | |
| | | private void InitTabRedPoint() |
| | | { |
| | | |
| | | |
| | | tabRedPointDict[PhantasmPavilionRepointType.Model] = new Redpoint(MainRedDot.PhantasmPavilionRepoint, GetRedpointId(PhantasmPavilionRepointType.Model)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.Face] = new Redpoint(MainRedDot.PhantasmPavilionRepoint, GetRedpointId(PhantasmPavilionRepointType.Face)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.Title] = new Redpoint(MainRedDot.PhantasmPavilionRepoint, GetRedpointId(PhantasmPavilionRepointType.Title)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.ModelNormal] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Model), GetRedpointId(PhantasmPavilionRepointType.ModelNormal)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.ModelEvent] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Model), GetRedpointId(PhantasmPavilionRepointType.ModelEvent)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.FaceAvatar] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Face), GetRedpointId(PhantasmPavilionRepointType.FaceAvatar)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.FaceFrame] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Face), GetRedpointId(PhantasmPavilionRepointType.FaceFrame)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.FaceBubble] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Face), GetRedpointId(PhantasmPavilionRepointType.FaceBubble)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.TitlePalace] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Title), GetRedpointId(PhantasmPavilionRepointType.TitlePalace)); |
| | | tabRedPointDict[PhantasmPavilionRepointType.TitleEvent] = new Redpoint(GetRedpointId(PhantasmPavilionRepointType.Title), GetRedpointId(PhantasmPavilionRepointType.TitleEvent)); |
| | | } |
| | | public int GetRedpointId(PhantasmPavilionRepointType type) |
| | | { |
| | | return MainRedDot.PhantasmPavilionRepoint * 100 + (int)type; |
| | | } |
| | | |
| | | void UpdateRedPointByCanActivate(PhantasmPavilionType type, PhantasmPavilionRepointType redType, int tabType = 0) |
| | | { |
| | | List<int> list = ShowItemList(type, tabType); |
| | | if (list.IsNullOrEmpty() || !tabRedPointDict.ContainsKey(redType)) |
| | | return; |
| | | foreach (var id in list) |
| | | { |
| | | if (!Has(type, id)) |
| | | continue; |
| | | PhantasmPavilionState state = GetUnLockState(type, id); |
| | | if (state == PhantasmPavilionState.CanActivate) |
| | | { |
| | | tabRedPointDict[redType].state = RedPointState.Simple; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void UpdateRedPointByCanUpStar(PhantasmPavilionType type, PhantasmPavilionRepointType redType, int tabType = 0) |
| | | { |
| | | List<int> list = ShowItemList(type, tabType); |
| | | if (list.IsNullOrEmpty() || !tabRedPointDict.ContainsKey(redType)) |
| | | return; |
| | | foreach (var id in list) |
| | | { |
| | | if (!Has(type, id)) |
| | | continue; |
| | | bool isCanUpStar = CheckCanUpByItem(type, id); |
| | | if (isCanUpStar) |
| | | { |
| | | tabRedPointDict[redType].state = RedPointState.Simple; |
| | | } |
| | | } |
| | | } |
| | | |
| | | void UpdateRedPointByNoSee(PhantasmPavilionType type, PhantasmPavilionRepointType redType, int tabType = 0) |
| | | { |
| | | List<int> list = ShowItemList(type, tabType); |
| | | if (list.IsNullOrEmpty() || !tabRedPointDict.ContainsKey(redType)) |
| | | return; |
| | | foreach (var id in list) |
| | | { |
| | | if (!Has(type, id)) |
| | | continue; |
| | | int unlockWay = GetUnlockWay(type, id); |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | if (unlockWay != 3) |
| | | continue; |
| | | bool hasNewHero = HasNewHero(type, unlockValue); |
| | | if (hasNewHero) |
| | | { |
| | | tabRedPointDict[redType].state = RedPointState.Simple; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void UpdateItemRedPoint(Image imgRed, PhantasmPavilionType type, int id) |
| | | { |
| | | imgRed.SetActive(false); |
| | | |
| | | if (!Has(type, id)) |
| | | return; |
| | | PhantasmPavilionState state = GetUnLockState(type, id); |
| | | if (state == PhantasmPavilionState.CanActivate) |
| | | { |
| | | imgRed.SetActive(true); |
| | | } |
| | | |
| | | bool isCanUpStar = CheckCanUpByItem(type, id); |
| | | if (isCanUpStar) |
| | | { |
| | | imgRed.SetActive(true); |
| | | } |
| | | |
| | | int unlockWay = GetUnlockWay(type, id); |
| | | if (unlockWay != 3) |
| | | return; |
| | | |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | bool hasNewHero = HasNewHero(type, unlockValue); |
| | | if (hasNewHero) |
| | | { |
| | | imgRed.SetActive(true); |
| | | } |
| | | } |
| | | public void UpdateRedPoint() |
| | | { |
| | | parentRedpoint.state = RedPointState.None; |
| | | |
| | | if (!tabRedPointDict.IsNullOrEmpty()) |
| | | { |
| | | foreach (var item in tabRedPointDict) |
| | | { |
| | | item.Value.state = RedPointState.None; |
| | | } |
| | | } |
| | | |
| | | // 有可手动解锁的 |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelNormal, 1); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelEvent, 2); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.Face, PhantasmPavilionRepointType.FaceAvatar); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.FacePic, PhantasmPavilionRepointType.FaceFrame); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.ChatBox, PhantasmPavilionRepointType.FaceBubble); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitlePalace, 1); |
| | | UpdateRedPointByCanActivate(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitleEvent, 2); |
| | | |
| | | // 有可升级的 |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelNormal, 1); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelEvent, 2); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.Face, PhantasmPavilionRepointType.FaceAvatar); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.FacePic, PhantasmPavilionRepointType.FaceFrame); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.ChatBox, PhantasmPavilionRepointType.FaceBubble); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitlePalace, 1); |
| | | UpdateRedPointByCanUpStar(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitleEvent, 2); |
| | | |
| | | // 自动解锁未查看的 |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelNormal, 1); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.Model, PhantasmPavilionRepointType.ModelEvent, 2); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.Face, PhantasmPavilionRepointType.FaceAvatar); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.FacePic, PhantasmPavilionRepointType.FaceFrame); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.ChatBox, PhantasmPavilionRepointType.FaceBubble); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitlePalace, 1); |
| | | UpdateRedPointByNoSee(PhantasmPavilionType.Title, PhantasmPavilionRepointType.TitleEvent, 2); |
| | | |
| | | } |
| | | |
| | | public List<int> newHeroIDModelList = new List<int>(); |
| | | public List<int> newHeroIDFaceList = new List<int>(); |
| | | public void AddNewHero(int heroID) |
| | | { |
| | | AddNewHero(newHeroIDModelList, heroID); |
| | | AddNewHero(newHeroIDFaceList, heroID); |
| | | } |
| | | |
| | | void AddNewHero(List<int> list, int heroID) |
| | | { |
| | | if (list.Contains(heroID)) |
| | | return; |
| | | list.Add(heroID); |
| | | SaveLocal(); |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public void RemoveNewHero(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!Has(type, id)) |
| | | return; |
| | | int unlockWay = GetUnlockWay(type, id); |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | if (unlockWay != 3) |
| | | return; |
| | | |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Model: |
| | | RemoveNewHero(newHeroIDModelList, unlockValue); |
| | | break; |
| | | case PhantasmPavilionType.Face: |
| | | RemoveNewHero(newHeroIDFaceList, unlockValue); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | void RemoveNewHero(List<int> list, int heroID) |
| | | { |
| | | if (!list.Contains(heroID)) |
| | | return; |
| | | list.Remove(heroID); |
| | | SaveLocal(); |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public bool HasNewHero(PhantasmPavilionType type, int heroID) |
| | | { |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Model: |
| | | return newHeroIDModelList.Contains(heroID); |
| | | case PhantasmPavilionType.Face: |
| | | return newHeroIDFaceList.Contains(heroID); |
| | | default: |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | string modelkey { get { return StringUtility.Contact("PhantasmPavilion_Redponit_Model_", PlayerDatas.Instance.PlayerId); } } |
| | | string facekey { get { return StringUtility.Contact("PhantasmPavilion_Redponit_Face_", PlayerDatas.Instance.PlayerId); } } |
| | | public void SaveLocal() |
| | | { |
| | | LocalSave.SetIntArray(modelkey, newHeroIDModelList.ToArray()); |
| | | LocalSave.SetIntArray(facekey, newHeroIDFaceList.ToArray()); |
| | | } |
| | | public void LoadLocal() |
| | | { |
| | | LoadLocalModel(); |
| | | LoadLocalFace(); |
| | | } |
| | | |
| | | void LoadLocalModel() |
| | | { |
| | | if (!LocalSave.HasKey(modelkey)) |
| | | { |
| | | newHeroIDModelList = new List<int>(); |
| | | return; |
| | | } |
| | | |
| | | int[] arr = LocalSave.GetIntArray(modelkey); |
| | | if (arr.IsNullOrEmpty()) |
| | | { |
| | | newHeroIDModelList = new List<int>(); |
| | | return; |
| | | } |
| | | |
| | | newHeroIDModelList = arr.ToList(); |
| | | } |
| | | |
| | | void LoadLocalFace() |
| | | { |
| | | if (!LocalSave.HasKey(facekey)) |
| | | { |
| | | newHeroIDFaceList = new List<int>(); |
| | | return; |
| | | } |
| | | |
| | | int[] arr = LocalSave.GetIntArray(facekey); |
| | | if (arr.IsNullOrEmpty()) |
| | | { |
| | | newHeroIDFaceList = new List<int>(); |
| | | return; |
| | | } |
| | | |
| | | newHeroIDFaceList = arr.ToList(); |
| | | } |
| | | } |
| | | |
| | | public enum PhantasmPavilionRepointType |
| | | { |
| | | Model = 10, |
| | | Face = 20, |
| | | Title = 30, |
| | | |
| | | ModelNormal = 11, |
| | | ModelEvent = 12, |
| | | |
| | | FaceAvatar = 21, |
| | | FaceFrame = 22, |
| | | FaceBubble = 23, |
| | | |
| | | TitlePalace = 31, |
| | | TitleEvent = 32, |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 06d4eaa4dfa565046be8aed58dfe467c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public partial class PhantasmPavilionManager : GameSystemManager<PhantasmPavilionManager> |
| | | { |
| | | public event Action<PhantasmPavilionType> OnShowItemListChange; |
| | | private PhantasmPavilionType m_nowType; |
| | | public PhantasmPavilionType nowType |
| | | { |
| | | get |
| | | { |
| | | return m_nowType; |
| | | } |
| | | set |
| | | { |
| | | if (m_nowType == value) |
| | | return; |
| | | m_nowType = value; |
| | | OnShowItemListChange?.Invoke(value); |
| | | } |
| | | } |
| | | |
| | | public event Action<int> OnSelectItemIdChange; |
| | | private int m_selectId; |
| | | public int selectId |
| | | { |
| | | get { return m_selectId; } |
| | | set |
| | | { |
| | | if (m_selectId == value) |
| | | return; |
| | | m_selectId = value; |
| | | RemoveNewHero(nowType, value); |
| | | OnSelectItemIdChange?.Invoke(value); |
| | | } |
| | | } |
| | | |
| | | |
| | | //<类型,<id,PhantasmPavilionData>> |
| | | public Dictionary<PhantasmPavilionType, Dictionary<int, PhantasmPavilionData>> dataDict = new Dictionary<PhantasmPavilionType, Dictionary<int, PhantasmPavilionData>>(); |
| | | public event Action OnUpdateModelInfoEvent; |
| | | public event Action OnUpdateFacePicInfo; |
| | | public event Action OnUpdateChatBoxInfoEvent; |
| | | public event Action OnUpdateTitleInfoEvent; |
| | | public event Action OnUpdateFaceInfoEvent; |
| | | public event Action OnTimeOut; |
| | | public override void Init() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | InitTable(); |
| | | InitTabRedPoint(); |
| | | } |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent; |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | CheckTimeOut(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private void OnRefreshItemEvent(PackType type, int arg2, int arg3) |
| | | { |
| | | if (type != PackType.Item) |
| | | return; |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | private void OnPlayerLoginOk() |
| | | { |
| | | InitNowIDDict(); |
| | | LoadLocal(); |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | } |
| | | |
| | | public void OnBeforePlayerDataInitializeEvent() |
| | | { |
| | | dataDict.Clear(); |
| | | nowIDDict.Clear(); |
| | | } |
| | | private void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | UpdateNowIDDict(type); |
| | | } |
| | | |
| | | public int GetJumpIndex(PhantasmPavilionType type, int tabType = 0) |
| | | { |
| | | if (!TryGetRowCountMax(type, out int rowCountMax) || type != nowType) |
| | | return 0; |
| | | int id = selectId; |
| | | List<int> list = ShowItemList(type, tabType); |
| | | if (list.IsNullOrEmpty() || !list.Contains(id)) |
| | | return 0; |
| | | int index = list.IndexOf(id); |
| | | int rowCount = (int)Math.Ceiling((double)index / rowCountMax); |
| | | return Mathf.Max(0, rowCount - 1); |
| | | } |
| | | |
| | | public void SetSelectItemId(PhantasmPavilionType type, int tabType = 0) |
| | | { |
| | | List<int> list = new List<int>(); |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Model: |
| | | list = ModelConfig.GetTabTypeTitles(tabType); |
| | | break; |
| | | case PhantasmPavilionType.Title: |
| | | list = TitleConfig.GetTabTypeTitles(tabType); |
| | | break; |
| | | default: |
| | | list = GetTableKeys(type); |
| | | break; |
| | | } |
| | | if (list.IsNullOrEmpty() || !TryGetNowShowID(type, out int nowShowID)) |
| | | return; |
| | | |
| | | int id = nowShowID; |
| | | if (list.Contains(id)) |
| | | { |
| | | selectId = id; |
| | | return; |
| | | } |
| | | |
| | | foreach (var key in list) |
| | | { |
| | | bool isUnlock = IsUnlock(type, key); |
| | | if (isUnlock) |
| | | { |
| | | selectId = key; |
| | | return; |
| | | } |
| | | } |
| | | |
| | | selectId = list[0]; |
| | | } |
| | | |
| | | |
| | | // 检查是否满足“通过道具升级”的条件 |
| | | public bool CheckCanUpByItem(PhantasmPavilionType type, int id) |
| | | { |
| | | bool isUnlock = IsUnlock(type, id); |
| | | bool isCanStarAdd = HasStarAddAttr(type, id); |
| | | bool isStarMax = IsStarMax(type, id); |
| | | int unlockWay = GetUnlockWay(type, id); |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | if (!isUnlock || !isCanStarAdd || isStarMax || unlockWay != 2) |
| | | return false; |
| | | int itemId = unlockValue; |
| | | // 道具配置不存在 |
| | | if (!ItemConfig.HasKey(itemId)) |
| | | return false; |
| | | |
| | | ItemConfig itemConfig = ItemConfig.Get(itemId); |
| | | |
| | | // 玩家等级不足 |
| | | if (itemConfig.UseLV > PlayerDatas.Instance.baseData.LV) |
| | | return false; |
| | | |
| | | // 道具数量不足 |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId); |
| | | int upNeedCnt = GetUpNeedCnt(type, id); |
| | | if (hasCnt < upNeedCnt) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | public void ShowFace(ImageEx imgFace, UIEffectPlayer spine, UIFrame uiFrame, EllipseMask ellipseMask, int id) |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.Face; |
| | | int UnlockWay = GetUnlockWay(type, id); |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | int resourceType = GetResourceType(type, id); |
| | | string resourceValue = GetResourceValue(type, id); |
| | | if (UnlockWay == 3 && resourceValue == "") |
| | | { |
| | | int heroID = unlockValue; |
| | | if (!HeroConfig.HasKey(heroID)) |
| | | return; |
| | | HeroConfig heroConfig = HeroConfig.Get(heroID); |
| | | int skinID = heroConfig.SkinIDList[0]; |
| | | if (!HeroSkinConfig.HasKey(skinID)) |
| | | return; |
| | | HeroSkinConfig skinConfig = HeroSkinConfig.Get(skinID); |
| | | var sprite = UILoader.LoadSprite("HeroHead", skinConfig.SquareIcon); |
| | | if (sprite == null) |
| | | { |
| | | Show(imgFace, spine, uiFrame, resourceType, "herohead_default", null, ellipseMask); |
| | | } |
| | | else |
| | | { |
| | | Show(imgFace, spine, uiFrame, resourceType, string.Empty, sprite, ellipseMask); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | resourceValue = GetResourceValue(type, id); |
| | | Show(imgFace, spine, uiFrame, resourceType, resourceValue, null, ellipseMask); |
| | | } |
| | | |
| | | } |
| | | |
| | | public void Show(ImageEx imgFace, UIEffectPlayer spine, UIFrame uiFrame, int resourceType, string resourceValue, Sprite sprite = null, EllipseMask ellipseMask = null) |
| | | { |
| | | spine.Stop(); |
| | | |
| | | switch (resourceType) |
| | | { |
| | | // 静态图 |
| | | case 1: |
| | | imgFace.enabled = true; |
| | | spine.enabled = false; |
| | | uiFrame.enabled = false; |
| | | |
| | | |
| | | |
| | | if (sprite == null) |
| | | { |
| | | if (!IconConfig.HasKey(resourceValue)) |
| | | return; |
| | | imgFace.SetSprite(resourceValue); |
| | | } |
| | | else |
| | | { |
| | | imgFace.overrideSprite = sprite; |
| | | } |
| | | break; |
| | | case 2: // spine |
| | | imgFace.enabled = true; |
| | | uiFrame.enabled = false; |
| | | spine.enabled = true; |
| | | spine.effectId = int.Parse(resourceValue); |
| | | spine.isPlaySpineLoop = true; |
| | | spine.Play(); |
| | | break; |
| | | // 序列帧 |
| | | case 3: |
| | | imgFace.enabled = true; |
| | | spine.enabled = false; |
| | | uiFrame.enabled = true; |
| | | imgFace.sprite = null; |
| | | |
| | | if (!UIFrameMgr.Inst.ContainsDynamicImage(resourceValue)) |
| | | break; |
| | | //List<UnityEngine.Sprite> spriteList = UIFrameMgr.Inst.GetDynamicImage(resourceValue); |
| | | // if (!spriteList.IsNullOrEmpty()) |
| | | // { |
| | | // imgFace.rectTransform.sizeDelta = new Vector2(spriteList[0].rect.width, spriteList[0].rect.height); |
| | | // } |
| | | |
| | | uiFrame.ResetFrame(resourceValue); |
| | | uiFrame.enabled = true; |
| | | break; |
| | | } |
| | | |
| | | if (ellipseMask != null) |
| | | { |
| | | ellipseMask.UpdateChildrenStencil(); |
| | | } |
| | | } |
| | | |
| | | public bool TryGetInfo(PhantasmPavilionType type, int id, out PhantasmPavilionData info) |
| | | { |
| | | info = null; |
| | | return dataDict.TryGetValue(type, out var dict) && dict.TryGetValue(id, out info); |
| | | } |
| | | |
| | | // 有没有属性 |
| | | public bool HasInitAttr(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!Has(type, id)) |
| | | return false; |
| | | int[] attrIDList = GetAttrIDList(type, id); |
| | | int[] initAttrValueList = GetInitAttrValueList(type, id); |
| | | if (attrIDList.IsNullOrEmpty() || initAttrValueList.IsNullOrEmpty() || attrIDList.Length != initAttrValueList.Length) |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | |
| | | //是否已经升满星 |
| | | public bool IsStarMax(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!HasStarAddAttr(type, id)) |
| | | return false; |
| | | if (!TryGetInfo(type, id, out PhantasmPavilionData info)) |
| | | return false; |
| | | int starMax = GetStarMax(type, id); |
| | | return info.Star >= starMax; |
| | | } |
| | | |
| | | // 是否可升星 |
| | | public bool HasStarAddAttr(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!Has(type, id)) |
| | | return false; |
| | | if (!HasInitAttr(type, id)) |
| | | return false; |
| | | int[] initAttrValueList = GetInitAttrValueList(type, id); |
| | | int[] AttrPerStarAddList = GetAttrPerStarAddList(type, id); |
| | | if (initAttrValueList.IsNullOrEmpty() || AttrPerStarAddList.IsNullOrEmpty() || initAttrValueList.Length != AttrPerStarAddList.Length) |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | public bool IsUsing(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!Has(type, id)) |
| | | return false; |
| | | if (!TryGetNowShowID(type, out int result)) |
| | | return false; |
| | | return result == id; |
| | | } |
| | | |
| | | public List<int> ShowItemList(PhantasmPavilionType type, int tabType = 0) |
| | | { |
| | | var resList = new List<int>(); |
| | | switch (type) |
| | | { |
| | | case PhantasmPavilionType.Model: |
| | | resList = ModelConfig.GetTabTypeTitles(tabType); |
| | | break; |
| | | case PhantasmPavilionType.Title: |
| | | resList = TitleConfig.GetTabTypeTitles(tabType); |
| | | break; |
| | | default: |
| | | resList = GetTableKeys(type); |
| | | break; |
| | | } |
| | | resList.Sort((int a, int b) => Cmp(a, b, type)); |
| | | return resList; |
| | | } |
| | | |
| | | public int Cmp(int a, int b, PhantasmPavilionType type) |
| | | { |
| | | // 获取 a 和 b 的解锁状态 |
| | | int stateA = (int)GetUnLockState(type, a); |
| | | int stateB = (int)GetUnLockState(type, b); |
| | | |
| | | // 将状态重新定义为优先级排序数值:已激活(2) > 可激活(1) > 未激活(0) |
| | | int priorityA = stateA == 2 ? 0 : (stateA == 1 ? 1 : 2); |
| | | int priorityB = stateB == 2 ? 0 : (stateB == 1 ? 1 : 2); |
| | | |
| | | |
| | | if (priorityA != priorityB) |
| | | { |
| | | return priorityA.CompareTo(priorityB); |
| | | } |
| | | return a.CompareTo(b); |
| | | } |
| | | |
| | | // 除道具解锁外,其他方式暂默认永久 |
| | | // 是否有时效 true 有时间限制 false 永久(无时间限制) |
| | | public bool IsLimitTime(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!Has(type, id)) |
| | | return false; |
| | | |
| | | // 如果不是“道具解锁”方式,也视为永久 |
| | | if (GetUnlockWay(type, id) != (int)PhantasmPavilionUnlockWay.Item) |
| | | return false; |
| | | |
| | | // 物品存在且是“道具解锁”,取决于有效期 |
| | | int expireMinutes = GetExpireMinutes(type, id); |
| | | return expireMinutes > 0; |
| | | } |
| | | |
| | | //物品是否已过期 |
| | | private bool IsExpired(PhantasmPavilionData info, PhantasmPavilionUnlockWay unlockWay) |
| | | { |
| | | // 只有“道具”方式才需要检查时效,武将解锁(Hero) 或 默认(Activate) 视为永久 |
| | | if (unlockWay != PhantasmPavilionUnlockWay.Item) |
| | | return false; |
| | | |
| | | // EndTime == 0 表示永久 |
| | | bool isLimitedTime = info.EndTime > 0; |
| | | if (!isLimitedTime) |
| | | return false; |
| | | |
| | | // 是限时道具,检查当前时间是否已经超过了截止时间 |
| | | bool timeHasPassed = info.EndTime < TimeUtility.AllSeconds; |
| | | return timeHasPassed; |
| | | } |
| | | |
| | | // 除道具解锁外,其他方式暂默认永久 |
| | | // 1 - 默认解锁,即创角就可用的 |
| | | // 2 - 道具解锁,支持时效、升级, Value配物品ID |
| | | // 3 - 关联武将解锁,Value配武将ID |
| | | public bool IsUnlock(PhantasmPavilionType type, int id) |
| | | { |
| | | // 配置表中不存在,视为未解锁 |
| | | if (!Has(type, id)) |
| | | return false; |
| | | |
| | | int unlockWayValue = GetUnlockWay(type, id); |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | // 解锁方式无效 |
| | | if (!Enum.IsDefined(typeof(PhantasmPavilionUnlockWay), unlockWayValue)) |
| | | return false; |
| | | var unlockWay = (PhantasmPavilionUnlockWay)unlockWayValue; |
| | | |
| | | switch (unlockWay) |
| | | { |
| | | case PhantasmPavilionUnlockWay.Activate: |
| | | return true; |
| | | case PhantasmPavilionUnlockWay.Hero: |
| | | bool hasHero = HeroManager.Instance.HasHero(unlockValue); |
| | | return hasHero; |
| | | case PhantasmPavilionUnlockWay.Item: |
| | | // 封包里没有 |
| | | if (!TryGetInfo(type, id, out var info)) |
| | | return false; |
| | | // 玩家数据中的状态是“未激活” |
| | | if (!info.State) |
| | | return false; |
| | | // 是否为“已过期的道具” |
| | | if (IsExpired(info, unlockWay)) |
| | | return false; |
| | | return true; |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获得当前状态 |
| | | /// </summary> |
| | | /// <returns>0 - 未激活, 1 - 可激活, 2 - 已激活</returns> |
| | | public PhantasmPavilionState GetUnLockState(PhantasmPavilionType type, int id) |
| | | { |
| | | // 配置表中不存在,视为“未激活” |
| | | if (!Has(type, id)) |
| | | return PhantasmPavilionState.Locked; |
| | | |
| | | // 已经解锁 |
| | | if (IsUnlock(type, id)) |
| | | return PhantasmPavilionState.Activated; |
| | | |
| | | // 运行到这里,说明物品是“未激活”或“已过期”状态 (IsUnlock 返回 false) |
| | | // 无效的解锁方式 |
| | | int unlockWayValue = GetUnlockWay(type, id); |
| | | if (!Enum.IsDefined(typeof(PhantasmPavilionUnlockWay), unlockWayValue)) |
| | | return PhantasmPavilionState.Locked; |
| | | |
| | | var unlockWay = (PhantasmPavilionUnlockWay)unlockWayValue; |
| | | int unlockValue = GetUnlockValue(type, id); |
| | | |
| | | switch (unlockWay) |
| | | { |
| | | // 检查道具激活条件 |
| | | case PhantasmPavilionUnlockWay.Item: |
| | | return CheckCanActivateByItem(type, id, unlockValue) |
| | | ? PhantasmPavilionState.CanActivate |
| | | : PhantasmPavilionState.Locked; |
| | | // 检查武将激活条件 |
| | | case PhantasmPavilionUnlockWay.Hero: |
| | | int heroID = unlockValue; |
| | | return HeroManager.Instance.HasHero(heroID) |
| | | ? PhantasmPavilionState.Activated |
| | | : PhantasmPavilionState.Locked; |
| | | default: |
| | | return PhantasmPavilionState.Locked; |
| | | } |
| | | } |
| | | |
| | | // 检查是否满足“通过道具激活”的条件 |
| | | private bool CheckCanActivateByItem(PhantasmPavilionType type, int id, int itemId) |
| | | { |
| | | // 道具配置不存在 |
| | | if (!ItemConfig.HasKey(itemId)) |
| | | return false; |
| | | |
| | | ItemConfig itemConfig = ItemConfig.Get(itemId); |
| | | |
| | | // 玩家等级不足 |
| | | if (itemConfig.UseLV > PlayerDatas.Instance.baseData.LV) |
| | | return false; |
| | | |
| | | // 道具数量不足 |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, itemId); |
| | | int unlockNeedCnt = GetUnlockNeedCnt(type, id); |
| | | if (hasCnt < unlockNeedCnt) |
| | | return false; |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public void CheckTimeOut() |
| | | { |
| | | bool isTimeOut = false; |
| | | var expiredItems = new Dictionary<PhantasmPavilionType, List<int>>(); |
| | | |
| | | if (dataDict.IsNullOrEmpty()) |
| | | return; |
| | | |
| | | // 单次遍历:检查限时物品并收集过期项目 |
| | | foreach (var kv in dataDict) |
| | | { |
| | | var type = kv.Key; |
| | | var dict = kv.Value; |
| | | foreach (var kv2 in dict) |
| | | { |
| | | var id = kv2.Key; |
| | | var data = kv2.Value; |
| | | |
| | | // 只检查限时物品 |
| | | if (!IsLimitTime(type, id)) |
| | | continue; |
| | | |
| | | int unlockWay = GetUnlockWay(type, id); |
| | | bool isExpired = IsExpired(data, (PhantasmPavilionUnlockWay)unlockWay); |
| | | |
| | | if (isExpired) |
| | | { |
| | | isTimeOut = true; |
| | | |
| | | if (!expiredItems.ContainsKey(type)) |
| | | { |
| | | expiredItems[type] = new List<int>(); |
| | | } |
| | | if (!expiredItems[type].Contains(id)) |
| | | { |
| | | expiredItems[type].Add(id); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果没有过期物品,直接返回 |
| | | if (!isTimeOut) |
| | | return; |
| | | |
| | | // 从dataDict中移除过期的项目 |
| | | if (!expiredItems.IsNullOrEmpty()) |
| | | { |
| | | foreach (var kv in expiredItems) |
| | | { |
| | | var type = kv.Key; |
| | | var list = kv.Value; |
| | | if (dataDict.ContainsKey(type)) |
| | | { |
| | | foreach (var id in list) |
| | | { |
| | | dataDict[type].Remove(id); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | OnTimeOut?.Invoke(); |
| | | } |
| | | |
| | | #region 收封包 |
| | | public event Action OnUpdateModelStarAdd; |
| | | public void UpdateModelInfo(HB119_tagSCModelInfo vNetData) |
| | | { |
| | | if (vNetData == null) |
| | | return; |
| | | |
| | | PhantasmPavilionType type = PhantasmPavilionType.Model; |
| | | if (!dataDict.ContainsKey(type)) |
| | | { |
| | | dataDict.Add(type, new Dictionary<int, PhantasmPavilionData>()); |
| | | } |
| | | |
| | | // 判断当前封包是否有任何一项的星级大于之前的星级 |
| | | bool hasStarIncreased = false; |
| | | foreach (var item in vNetData.ModelList) |
| | | { |
| | | if (dataDict[type].ContainsKey((int)item.ModelID)) |
| | | { |
| | | var oldData = dataDict[type][(int)item.ModelID]; |
| | | if (item.Star > oldData.Star) |
| | | { |
| | | hasStarIncreased = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | foreach (var item in vNetData.ModelList) |
| | | { |
| | | if (!dataDict[type].ContainsKey((int)item.ModelID)) |
| | | { |
| | | dataDict[type][(int)item.ModelID] = new PhantasmPavilionData(); |
| | | } |
| | | |
| | | var data = dataDict[type][(int)item.ModelID]; |
| | | data.ID = item.ModelID; |
| | | data.State = item.State == 1; |
| | | data.EndTime = item.EndTime; |
| | | data.Star = item.Star; |
| | | } |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | if (hasStarIncreased) |
| | | { |
| | | OnUpdateModelStarAdd?.Invoke(); |
| | | } |
| | | OnUpdateModelInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | |
| | | public void UpdateTitleInfo(HB126_tagSCTitleInfo vNetData) |
| | | { |
| | | if (vNetData == null) |
| | | return; |
| | | PhantasmPavilionType type = PhantasmPavilionType.Title; |
| | | if (!dataDict.ContainsKey(type)) |
| | | { |
| | | dataDict.Add(type, new Dictionary<int, PhantasmPavilionData>()); |
| | | } |
| | | |
| | | foreach (var item in vNetData.TitleList) |
| | | { |
| | | if (!dataDict[type].ContainsKey((int)item.TitleID)) |
| | | { |
| | | dataDict[type][(int)item.TitleID] = new PhantasmPavilionData(); |
| | | } |
| | | |
| | | var data = dataDict[type][(int)item.TitleID]; |
| | | data.ID = item.TitleID; |
| | | data.State = item.State == 1; |
| | | data.EndTime = item.EndTime; |
| | | data.Star = item.Star; |
| | | } |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | OnUpdateTitleInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | |
| | | public void UpdateChatBoxInfo(HB127_tagSCChatBoxInfo vNetData) |
| | | { |
| | | if (vNetData == null) |
| | | return; |
| | | PhantasmPavilionType type = PhantasmPavilionType.ChatBox; |
| | | if (!dataDict.ContainsKey(type)) |
| | | { |
| | | dataDict.Add(type, new Dictionary<int, PhantasmPavilionData>()); |
| | | } |
| | | |
| | | foreach (var item in vNetData.BoxList) |
| | | { |
| | | if (!dataDict[type].ContainsKey((int)item.BoxID)) |
| | | { |
| | | dataDict[type][(int)item.BoxID] = new PhantasmPavilionData(); |
| | | } |
| | | |
| | | var data = dataDict[type][(int)item.BoxID]; |
| | | data.ID = item.BoxID; |
| | | data.State = item.State == 1; |
| | | data.EndTime = item.EndTime; |
| | | data.Star = item.Star; |
| | | } |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | OnUpdateChatBoxInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | |
| | | public void UpdateFaceInfo(HB117_tagMCFaceInfo vNetData) |
| | | { |
| | | if (vNetData == null) |
| | | return; |
| | | PhantasmPavilionType type = PhantasmPavilionType.Face; |
| | | if (!dataDict.ContainsKey(type)) |
| | | { |
| | | dataDict.Add(type, new Dictionary<int, PhantasmPavilionData>()); |
| | | } |
| | | |
| | | foreach (var item in vNetData.FaceList) |
| | | { |
| | | if (!dataDict[type].ContainsKey((int)item.FaceID)) |
| | | { |
| | | dataDict[type][(int)item.FaceID] = new PhantasmPavilionData(); |
| | | } |
| | | |
| | | var data = dataDict[type][(int)item.FaceID]; |
| | | data.ID = item.FaceID; |
| | | data.State = item.State == 1; |
| | | data.EndTime = item.EndTime; |
| | | data.Star = item.Star; |
| | | } |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | OnUpdateFaceInfoEvent?.Invoke(); |
| | | } |
| | | |
| | | |
| | | public void UpdateFacePicInfo(HB118_tagMCFacePicInfo vNetData) |
| | | { |
| | | if (vNetData == null) |
| | | return; |
| | | PhantasmPavilionType type = PhantasmPavilionType.FacePic; |
| | | if (!dataDict.ContainsKey(type)) |
| | | { |
| | | dataDict.Add(type, new Dictionary<int, PhantasmPavilionData>()); |
| | | } |
| | | |
| | | foreach (var item in vNetData.FacePicList) |
| | | { |
| | | if (!dataDict[type].ContainsKey((int)item.FacePicID)) |
| | | { |
| | | dataDict[type][(int)item.FacePicID] = new PhantasmPavilionData(); |
| | | } |
| | | |
| | | var data = dataDict[type][(int)item.FacePicID]; |
| | | data.ID = item.FacePicID; |
| | | data.State = item.State == 1; |
| | | data.EndTime = item.EndTime; |
| | | data.Star = item.Star; |
| | | } |
| | | RefreshAttr(); |
| | | UpdateRedPoint(); |
| | | OnUpdateFacePicInfo?.Invoke(); |
| | | } |
| | | #endregion |
| | | |
| | | public void SendOPPack(PhantasmPavilionType type, PhantasmPavilionOperation op, uint opID) |
| | | { |
| | | SendB225Pack((byte)type, (byte)op, opID); |
| | | } |
| | | |
| | | public void SendB225Pack(byte type, byte opType, uint opID) |
| | | { |
| | | var pack = new CB225_tagCSHJGOP(); |
| | | pack.Type = type; // 类型 1-形象;2-头像;3-头像框;4-气泡;5-称号 |
| | | pack.OPType = opType; // 操作 1-激活;2-佩戴;3-卸下;4-升星 |
| | | pack.OPID = opID; // 操作对应的ID,如形象ID等 |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | } |
| | | |
| | | public class PhantasmPavilionData |
| | | { |
| | | public uint ID; //ID |
| | | public bool State; //是否已激活 |
| | | public uint EndTime; //到期时间戳,0为永久 |
| | | public byte Star; //星级 |
| | | } |
| | | |
| | | //对应发包 1-形象;2-头像;3-头像框;4-气泡;5-称号 |
| | | public enum PhantasmPavilionType |
| | | { |
| | | Model = 1, // 形象 |
| | | Face, // 头像 |
| | | FacePic, // 头像框 |
| | | ChatBox, // 聊天气泡 |
| | | Title, //称号 |
| | | } |
| | | |
| | | //对应发包 1-激活;2-佩戴;3-卸下;4-升星 |
| | | public enum PhantasmPavilionOperation |
| | | { |
| | | Activate = 1, // 激活 |
| | | Wear, // 佩戴 |
| | | Remove, // 卸下 |
| | | UpgradeStar, // 升星 |
| | | } |
| | | |
| | | public enum PhantasmPavilionUnlockWay |
| | | { |
| | | Activate = 1, // 默认(创角色就可以用的) |
| | | Item, // 道具 |
| | | Hero, // 武将 |
| | | } |
| | | |
| | | /// 幻境阁物品的状态 |
| | | public enum PhantasmPavilionState |
| | | { |
| | | // 未激活 (0) |
| | | Locked = 0, |
| | | // 可激活 (1) - 满足激活条件,但尚未激活 |
| | | CanActivate = 1, |
| | | //已激活 (2) - 已激活且未过期 |
| | | Activated = 2 |
| | | } |
| | | |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionManager.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 1ef87e456d444734991a9ea63aea1e99 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionModelCell : MonoBehaviour |
| | | { |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Model; |
| | | [SerializeField] List<PhantasmPavilionModelItem> items = new List<PhantasmPavilionModelItem>(); |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int rowIndex, CellView cellView) |
| | | { |
| | | int tabType = cellView.info.Value.infoInt1; |
| | | List<int> showItemList = manager.ShowItemList(type, tabType); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | int index = rowIndex * rowCountMax + i; |
| | | if (!showItemList.IsNullOrEmpty()) |
| | | { |
| | | if (index < showItemList.Count) |
| | | { |
| | | items[i].SetActive(true); |
| | | items[i].Display(showItemList[index]); |
| | | } |
| | | else |
| | | { |
| | | items[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionModelCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: bd8704f99e3542e419d17c23574200e6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class PhantasmPavilionModelHandler : IPhantasmPavilionHandler |
| | | { |
| | | public bool HasTableKey(int id) |
| | | { |
| | | return ModelConfig.HasKey(id); |
| | | } |
| | | public List<int> GetKeyList() |
| | | { |
| | | return ModelConfig.GetKeys(); |
| | | } |
| | | public int GetResourceType(int id) |
| | | { |
| | | return 0; |
| | | } |
| | | public string GetResourceValue(int id) |
| | | { |
| | | return string.Empty; |
| | | } |
| | | |
| | | public string GetName(int id) |
| | | { |
| | | return ModelConfig.Get(id).Name; |
| | | } |
| | | public int GetExpireMinutes(int id) |
| | | { |
| | | return ModelConfig.Get(id).ExpireMinutes; |
| | | } |
| | | public int GetUnlockWay(int id) |
| | | { |
| | | return ModelConfig.Get(id).UnlockWay; |
| | | } |
| | | public int GetUnlockValue(int id) |
| | | { |
| | | return ModelConfig.Get(id).UnlockValue; |
| | | } |
| | | public int GetUnlockNeedCnt(int id) |
| | | { |
| | | return ModelConfig.Get(id).UnlockNeedCnt; |
| | | } |
| | | public int GetUpNeedCnt(int id) |
| | | { |
| | | return ModelConfig.Get(id).UpNeedCnt; |
| | | } |
| | | public int GetStarMax(int id) |
| | | { |
| | | return ModelConfig.Get(id).StarMax; |
| | | } |
| | | public int[] GetAttrIDList(int id) |
| | | { |
| | | return ModelConfig.Get(id).AttrIDList; |
| | | } |
| | | public int[] GetInitAttrValueList(int id) |
| | | { |
| | | return ModelConfig.Get(id).InitAttrValueList; |
| | | } |
| | | public int[] GetAttrPerStarAddList(int id) |
| | | { |
| | | return ModelConfig.Get(id).AttrPerStarAddList; |
| | | } |
| | | public string GetGetWayString(int id) |
| | | { |
| | | return ModelConfig.Get(id).GetWayString; |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionModelHandler.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 0ffc05fccadbe43429af9dee551c9345 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionModelItem : MonoBehaviour |
| | | { |
| | | [SerializeField] EllipseMask mask; |
| | | [SerializeField] ImageEx imgBg; |
| | | [SerializeField] ImageEx imgFace; |
| | | [SerializeField] Button btnChoose; |
| | | |
| | | [SerializeField] ImageEx imgLimit; |
| | | [SerializeField] ImageEx imgLock; |
| | | [SerializeField] ImageEx imgChoose; |
| | | [SerializeField] ImageEx imgCanUnlock; |
| | | [SerializeField] TextEx txtUsing; |
| | | [SerializeField] Image imgRed; |
| | | |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Model; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | this.id = id; |
| | | btnChoose.SetListener(() => |
| | | { |
| | | manager.selectId = id; |
| | | }); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isLimitedTime = manager.IsLimitTime(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | imgChoose.SetActive(manager.selectId == id); |
| | | imgLimit.SetActive(state == PhantasmPavilionState.Activated && isLimitedTime); |
| | | imgLock.SetActive(state != PhantasmPavilionState.Activated); |
| | | imgCanUnlock.SetActive(state == PhantasmPavilionState.CanActivate); |
| | | txtUsing.SetActive(state == PhantasmPavilionState.Activated && isUsing); |
| | | |
| | | if (!ModelConfig.HasKey(id)) |
| | | return; |
| | | ModelConfig model = ModelConfig.Get(id); |
| | | int skinID = model.SkinID; |
| | | if (!HeroSkinConfig.HasKey(skinID)) |
| | | return; |
| | | HeroSkinConfig skinConfig = HeroSkinConfig.Get(skinID); |
| | | var sprite = UILoader.LoadSprite("HeroHead", skinConfig.SquareIcon); |
| | | if (sprite == null) |
| | | { |
| | | // 内网未配置时 |
| | | imgFace.SetSprite("herohead_default"); |
| | | } |
| | | else |
| | | { |
| | | imgFace.overrideSprite = sprite; |
| | | } |
| | | |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | |
| | | imgBg.SetSprite(model.FaceBg); |
| | | |
| | | manager.UpdateItemRedPoint(imgRed, type, id); |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionModelItem.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: ee7ff516c103fef43abe59ed7ce5eeed |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionModelWin : UIBase |
| | | { |
| | | [SerializeField] float modelSize; |
| | | [SerializeField] float lhSize; |
| | | [SerializeField] ButtonEx btnAllAdd; |
| | | [Header("二级标签页")] |
| | | [SerializeField] GroupButtonEx btnTabType1; |
| | | [SerializeField] GroupButtonEx btnTabType2; |
| | | |
| | | [Header("选中项展示")] |
| | | //当前气泡 |
| | | [SerializeField] Transform lhframe; |
| | | [SerializeField] UIHeroController heroIh; |
| | | [SerializeField] UIHeroController heroModel; |
| | | [SerializeField] UIEffectPlayer heroAddStar; |
| | | |
| | | [Header("属性展示")] |
| | | [SerializeField] TextEx txtName; |
| | | [SerializeField] TextEx txtGetWayString; |
| | | [SerializeField] TextEx txtAddInfo; |
| | | [SerializeField] TextEx txtUnLockInfo; |
| | | [SerializeField] TextEx txtNoInfo; |
| | | [SerializeField] ScrollerController scrInfo; |
| | | |
| | | [Header("滚动列表")] |
| | | [SerializeField] ScrollerController scrModel; |
| | | |
| | | [Header("按钮")] |
| | | [SerializeField] PhantasmPavilionUnlockButton btnUnlock; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn1; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn2; |
| | | [SerializeField] PhantasmPavilionAddStarButton btnAddStar; |
| | | [SerializeField] TextEx txtRemainingTime1; |
| | | [SerializeField] TextEx txtRemainingTime2; |
| | | |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | btnTabType1.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.Model, 0); }); |
| | | btnTabType2.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.Model, 1); }); |
| | | btnAllAdd.AddListener(() => { AttributeManager.Instance.OpenTotalAttributeWin(manager.GetTotalAttr()); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | scrInfo.OnRefreshCell += OnRefreshInfoCell; |
| | | scrModel.OnRefreshCell += OnRefreshModelCell; |
| | | manager.OnSelectItemIdChange += OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateModelInfoEvent += OnUpdateModelInfoEvent; |
| | | manager.OnTimeOut += OnTimeOut; |
| | | manager.OnUpdateModelStarAdd += OnUpdateModelStarAdd; |
| | | InitRedPoint(); |
| | | TabSetActive(); |
| | | SelectTiltleBtn(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | scrInfo.OnRefreshCell -= OnRefreshInfoCell; |
| | | scrModel.OnRefreshCell -= OnRefreshModelCell; |
| | | manager.OnSelectItemIdChange -= OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateModelInfoEvent -= OnUpdateModelInfoEvent; |
| | | manager.OnTimeOut -= OnTimeOut; |
| | | manager.OnUpdateModelStarAdd -= OnUpdateModelStarAdd; |
| | | } |
| | | |
| | | private void OnTimeOut() |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1); |
| | | } |
| | | |
| | | private void OnUpdateModelInfoEvent() |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1); |
| | | } |
| | | |
| | | private void OnUpdateModelStarAdd() |
| | | { |
| | | heroAddStar.Play(); |
| | | } |
| | | |
| | | void InitRedPoint() |
| | | { |
| | | btnTabType1.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.ModelNormal); |
| | | btnTabType2.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.ModelEvent); |
| | | } |
| | | |
| | | void SelectTiltleBtn() |
| | | { |
| | | functionOrder = 0; |
| | | btnTabType1.SelectBtn(); |
| | | SelectTeamFunc(PhantasmPavilionType.Model, 0); |
| | | } |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type, int order) |
| | | { |
| | | manager.SetSelectItemId(type, order + 1); |
| | | manager.nowType = type; |
| | | functionOrder = order; |
| | | CreateAll(); |
| | | } |
| | | |
| | | private void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | if (type != PlayerDataType.ModelMark) |
| | | return; |
| | | RefreshAll(manager.nowType, functionOrder + 1, false); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | bool isLimitedTime = manager.IsLimitTime(manager.nowType, manager.selectId); |
| | | if (isLimitedTime) |
| | | { |
| | | UpdateTimer(manager.nowType, manager.selectId); |
| | | } |
| | | } |
| | | |
| | | private void OnRefreshItemEvent(PackType type, int arg2, int arg3) |
| | | { |
| | | if (type != PackType.Item) |
| | | return; |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | } |
| | | |
| | | private void OnSelectItemIdChange(int id) |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1, false); |
| | | } |
| | | |
| | | private void RefreshAll(PhantasmPavilionType type, int tabType, bool isJump = true) |
| | | { |
| | | scrModel.m_Scorller.RefreshActiveCellViews(); |
| | | if (isJump) |
| | | { |
| | | scrModel.JumpIndex(manager.GetJumpIndex(type, tabType)); |
| | | } |
| | | CreateInfoScroller(); |
| | | DisplayButton(type, manager.selectId); |
| | | DisplayInfo(type, manager.selectId); |
| | | } |
| | | |
| | | void CreateAll() |
| | | { |
| | | CreateModelScroller(); |
| | | CreateInfoScroller(); |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | DisplayInfo(manager.nowType, manager.selectId); |
| | | } |
| | | |
| | | private void OnRefreshInfoCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionInfoCell>(); |
| | | _cell?.Display(cell.index, cell); |
| | | } |
| | | |
| | | private void OnRefreshModelCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionModelCell>(); |
| | | _cell?.Display(cell.index, cell); |
| | | } |
| | | |
| | | public void DisplayInfo(PhantasmPavilionType type, int id) |
| | | { |
| | | if (!ModelConfig.HasKey(id)) |
| | | return; |
| | | ModelConfig model = ModelConfig.Get(id); |
| | | int skinID = model.SkinID; |
| | | lhframe.transform.localScale = new Vector3(lhSize, lhSize, lhSize); |
| | | heroIh.Create(skinID, motionName: "", isLh: true); |
| | | heroModel.Create(skinID, modelSize); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | string name = manager.GetName(type, id); |
| | | if (isCanStarAdd && manager.TryGetInfo(type, id, out var info) && |
| | | state == PhantasmPavilionState.Activated && info.Star > 0) |
| | | { |
| | | txtName.text = StringUtility.Contact(name, " ", Language.Get("L1113", info.Star)); |
| | | } |
| | | else |
| | | { |
| | | txtName.text = name; |
| | | } |
| | | |
| | | txtGetWayString.text = Language.Get("PhantasmPavilion06", manager.GetGetWayString(type, id)); |
| | | |
| | | bool isHasAttr = manager.HasInitAttr(type, id); // 是否有解锁属性 |
| | | txtAddInfo.SetActive(state == PhantasmPavilionState.Activated); |
| | | txtUnLockInfo.SetActive(state != PhantasmPavilionState.Activated); |
| | | txtNoInfo.SetActive(!isHasAttr); |
| | | CreateInfoScroller(); |
| | | } |
| | | |
| | | public void DisplayButton(PhantasmPavilionType type, int id) |
| | | { |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | btnUnlock.SetActive(state != PhantasmPavilionState.Activated); |
| | | btnAddStar.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd); |
| | | btnPutOn1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && !isUsing); |
| | | btnPutOn2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && !isUsing); |
| | | btnUnlock.Display(id); |
| | | btnAddStar.Display(id); |
| | | btnPutOn1.Display(id); |
| | | btnPutOn2.Display(id); |
| | | |
| | | |
| | | UpdateTimer(type, id); |
| | | } |
| | | |
| | | |
| | | |
| | | private void CreateInfoScroller() |
| | | { |
| | | PhantasmPavilionType type = manager.nowType; |
| | | int id = manager.selectId; |
| | | if (!manager.Has(type, id)) |
| | | return; |
| | | scrInfo.Refresh(); |
| | | int[] attrIDList = manager.GetAttrIDList(type, id); |
| | | int[] initAttrValueList = manager.GetInitAttrValueList(type, id); |
| | | if (!attrIDList.IsNullOrEmpty() && !initAttrValueList.IsNullOrEmpty() && attrIDList.Length == initAttrValueList.Length) |
| | | { |
| | | for (int i = 0; i < attrIDList.Length; i++) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = id; |
| | | scrInfo.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | scrInfo.Restart(); |
| | | } |
| | | |
| | | public void TabSetActive() |
| | | { |
| | | var list = manager.ShowItemList(PhantasmPavilionType.Model, 1); |
| | | btnTabType1.SetActive(!list.IsNullOrEmpty()); |
| | | list = manager.ShowItemList(PhantasmPavilionType.Model, 2); |
| | | btnTabType2.SetActive(!list.IsNullOrEmpty()); |
| | | } |
| | | |
| | | private void CreateModelScroller() |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.Model; |
| | | scrModel.Refresh(); |
| | | int tabType = functionOrder + 1; |
| | | List<int> showItemList = manager.ShowItemList(PhantasmPavilionType.Model, tabType); |
| | | if (!showItemList.IsNullOrEmpty() && manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | { |
| | | int rowCount = (int)Math.Ceiling((double)showItemList.Count / rowCountMax); |
| | | for (int i = 0; i < rowCount; i++) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = tabType; |
| | | scrModel.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | scrModel.Restart(); |
| | | |
| | | scrModel.JumpIndex(manager.GetJumpIndex(type, tabType)); |
| | | |
| | | } |
| | | |
| | | public void UpdateTimer(PhantasmPavilionType type, int id) |
| | | { |
| | | bool isUnlock = manager.IsUnlock(type, id); |
| | | bool isLimitTime = manager.IsLimitTime(type, id); |
| | | if (!isUnlock || !isLimitTime || !manager.TryGetInfo(type, id, out var info) || info.EndTime <= 0) |
| | | { |
| | | txtRemainingTime1.SetActive(false); |
| | | txtRemainingTime2.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | |
| | | DateTime endDateTime = TimeUtility.OriginalTime.AddSeconds(info.EndTime); |
| | | TimeSpan remainingTime = endDateTime - TimeUtility.ServerNow; |
| | | int remainingSeconds = (int)remainingTime.TotalSeconds; |
| | | txtRemainingTime1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && remainingSeconds > 0); |
| | | txtRemainingTime2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && remainingSeconds > 0); |
| | | if (remainingSeconds > 0) |
| | | { |
| | | string countdownText = TimeUtility.SecondsToShortDHMS(remainingSeconds); |
| | | txtRemainingTime1.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | txtRemainingTime2.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionModelWin.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 5a0147739c582724c8db0dfee4029498 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionPutOnButton : MonoBehaviour |
| | | { |
| | | [SerializeField] ButtonEx btnPutOn; |
| | | [SerializeField] ImageEx imgPutOn; |
| | | [SerializeField] TextEx txtPutOn; |
| | | [SerializeField] Image imgRed; |
| | | PhantasmPavilionType type; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | type = manager.nowType; |
| | | this.id = id; |
| | | btnPutOn.SetListener(() => |
| | | { |
| | | manager.SendOPPack(type, PhantasmPavilionOperation.Wear, (uint)id); |
| | | }); |
| | | |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | if (type == PhantasmPavilionType.Title) |
| | | { |
| | | txtPutOn.text = Language.Get("EquipExchangeWin9"); |
| | | btnPutOn.interactable = true; |
| | | imgPutOn.gray = false; |
| | | } |
| | | else |
| | | { |
| | | |
| | | txtPutOn.text = Language.Get(isUsing ? "PhantasmPavilion09" : "EquipExchangeWin9"); |
| | | imgPutOn.gray = isUsing; |
| | | btnPutOn.interactable = !isUsing; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionPutOnButton.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 3aae4833e4cc05248ad37c215b956072 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionTitleWin : UIBase |
| | | { |
| | | [SerializeField] ButtonEx btnAllAdd; |
| | | [Header("二级标签页")] |
| | | [SerializeField] GroupButtonEx btnTabType1; |
| | | [SerializeField] GroupButtonEx btnTabType2; |
| | | |
| | | |
| | | [Header("选中项展示")] |
| | | //当前气泡 |
| | | [SerializeField] ImageEx imgNowChatBox; |
| | | [SerializeField] UIFrame uiFrameNowChatBox; |
| | | [SerializeField] UIEffectPlayer UIEffectPlayerNowChatBox; |
| | | |
| | | |
| | | [Header("属性展示")] |
| | | [SerializeField] TextEx txtName; |
| | | [SerializeField] TextEx txtGetWayString; |
| | | [SerializeField] TextEx txtAddInfo; |
| | | [SerializeField] TextEx txtUnLockInfo; |
| | | [SerializeField] TextEx txtNoInfo; |
| | | [SerializeField] ScrollerController scrInfo; |
| | | |
| | | [Header("滚动列表")] |
| | | [SerializeField] ScrollerController scrTitle; |
| | | |
| | | [Header("按钮")] |
| | | [SerializeField] PhantasmPavilionUnlockButton btnUnlock; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn1; |
| | | [SerializeField] PhantasmPavilionPutOnButton btnPutOn2; |
| | | [SerializeField] PhantasmPavilionAddStarButton btnAddStar; |
| | | [SerializeField] ButtonEx btnTakeOff1; |
| | | [SerializeField] ButtonEx btnTakeOff2; |
| | | [SerializeField] TextEx txtRemainingTime1; |
| | | [SerializeField] TextEx txtRemainingTime2; |
| | | |
| | | int nowTabType = 0; // 0-皇宫 1-活动 |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | protected override void InitComponent() |
| | | { |
| | | base.InitComponent(); |
| | | btnTakeOff1.AddListener(() => { manager.SendOPPack(PhantasmPavilionType.Title, PhantasmPavilionOperation.Remove, (uint)manager.selectId); }); |
| | | btnTakeOff2.AddListener(() => { manager.SendOPPack(PhantasmPavilionType.Title, PhantasmPavilionOperation.Remove, (uint)manager.selectId); }); |
| | | btnTabType1.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.Title, 0); }); |
| | | btnTabType2.AddListener(() => { SelectTeamFunc(PhantasmPavilionType.Title, 1); }); |
| | | btnAllAdd.AddListener(() => { AttributeManager.Instance.OpenTotalAttributeWin(manager.GetTotalAttr()); }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | scrInfo.OnRefreshCell += OnRefreshInfoCell; |
| | | scrTitle.OnRefreshCell += OnRefreshTitleCell; |
| | | manager.OnSelectItemIdChange += OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent += OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateTitleInfoEvent += OnUpdateTitleInfoEvent; |
| | | manager.OnTimeOut += OnTimeOut; |
| | | InitRedPoint(); |
| | | TabSetActive(); |
| | | SelectTiltleBtn(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | base.OnPreClose(); |
| | | scrInfo.OnRefreshCell -= OnRefreshInfoCell; |
| | | scrTitle.OnRefreshCell -= OnRefreshTitleCell; |
| | | manager.OnSelectItemIdChange -= OnSelectItemIdChange; |
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent; |
| | | GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent; |
| | | PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerDataRefreshEvent; |
| | | manager.OnUpdateTitleInfoEvent -= OnUpdateTitleInfoEvent; |
| | | manager.OnTimeOut -= OnTimeOut; |
| | | } |
| | | |
| | | private void OnUpdateTitleInfoEvent() |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1); |
| | | } |
| | | |
| | | private void OnTimeOut() |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1); |
| | | } |
| | | |
| | | void InitRedPoint() |
| | | { |
| | | btnTabType1.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.TitlePalace); |
| | | btnTabType2.redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.TitleEvent); |
| | | } |
| | | |
| | | void SelectTiltleBtn() |
| | | { |
| | | functionOrder = 0; |
| | | btnTabType1.SelectBtn(); |
| | | SelectTeamFunc(PhantasmPavilionType.Title, 0); |
| | | } |
| | | |
| | | void SelectTeamFunc(PhantasmPavilionType type, int order) |
| | | { |
| | | manager.SetSelectItemId(type, order + 1); |
| | | manager.nowType = type; |
| | | functionOrder = order; |
| | | CreateTitleScroller(); |
| | | CreateAll(); |
| | | } |
| | | |
| | | private void OnPlayerDataRefreshEvent(PlayerDataType type) |
| | | { |
| | | if (type != PlayerDataType.ExAttr3) |
| | | return; |
| | | RefreshAll(manager.nowType, functionOrder + 1, false); |
| | | } |
| | | |
| | | private void OnSecondEvent() |
| | | { |
| | | bool isLimitedTime = manager.IsLimitTime(manager.nowType, manager.selectId); |
| | | if (isLimitedTime) |
| | | { |
| | | UpdateTimer(manager.nowType, manager.selectId); |
| | | } |
| | | } |
| | | |
| | | private void OnRefreshItemEvent(PackType type, int arg2, int arg3) |
| | | { |
| | | if (type != PackType.Item) |
| | | return; |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | } |
| | | |
| | | private void OnSelectItemIdChange(int id) |
| | | { |
| | | RefreshAll(manager.nowType, functionOrder + 1, false); |
| | | } |
| | | |
| | | private void RefreshAll(PhantasmPavilionType type, int tabType, bool isJump = true) |
| | | { |
| | | scrTitle.m_Scorller.RefreshActiveCellViews(); |
| | | if (isJump) |
| | | { |
| | | scrTitle.JumpIndex(manager.GetJumpIndex(type, tabType)); |
| | | } |
| | | CreateInfoScroller(); |
| | | DisplayButton(type, manager.selectId); |
| | | DisplayInfo(type, manager.selectId); |
| | | } |
| | | |
| | | void CreateAll() |
| | | { |
| | | CreateTitleScroller(); |
| | | CreateInfoScroller(); |
| | | DisplayButton(manager.nowType, manager.selectId); |
| | | DisplayInfo(manager.nowType, manager.selectId); |
| | | } |
| | | private void OnRefreshInfoCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionInfoCell>(); |
| | | _cell?.Display(cell.index, cell); |
| | | } |
| | | |
| | | private void OnRefreshTitleCell(ScrollerDataType type, CellView cell) |
| | | { |
| | | var _cell = cell.GetComponent<PhantasmPavilionTitleCell>(); |
| | | _cell?.Display(cell.index, cell); |
| | | } |
| | | |
| | | public void DisplayInfo(PhantasmPavilionType type, int id) |
| | | { |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | manager.Show(imgNowChatBox, UIEffectPlayerNowChatBox, uiFrameNowChatBox, resourceType, resourceValue); |
| | | if (resourceType == 1) |
| | | { |
| | | imgNowChatBox.SetNativeSize(); |
| | | } |
| | | txtName.text = manager.GetName(type, id); |
| | | txtGetWayString.text = Language.Get("PhantasmPavilion06", manager.GetGetWayString(type, id)); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isHasAttr = manager.HasInitAttr(type, id); // 是否有解锁属性 |
| | | txtAddInfo.SetActive(state == PhantasmPavilionState.Activated); |
| | | txtUnLockInfo.SetActive(state != PhantasmPavilionState.Activated); |
| | | txtNoInfo.SetActive(!isHasAttr); |
| | | CreateInfoScroller(); |
| | | } |
| | | |
| | | public void DisplayButton(PhantasmPavilionType type, int id) |
| | | { |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | btnUnlock.SetActive(state != PhantasmPavilionState.Activated); |
| | | btnAddStar.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd); |
| | | btnPutOn1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && !isUsing); |
| | | btnPutOn2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && !isUsing); |
| | | btnTakeOff1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && isUsing); |
| | | btnTakeOff2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && isUsing); |
| | | |
| | | btnUnlock.Display(id); |
| | | btnAddStar.Display(id); |
| | | btnPutOn1.Display(id); |
| | | btnPutOn2.Display(id); |
| | | |
| | | UpdateTimer(type, id); |
| | | } |
| | | |
| | | void RefreshScroller(PhantasmPavilionType type) |
| | | { |
| | | scrTitle.m_Scorller.RefreshActiveCellViews(); |
| | | CreateInfoScroller(); |
| | | } |
| | | |
| | | |
| | | private void CreateInfoScroller() |
| | | { |
| | | PhantasmPavilionType type = manager.nowType; |
| | | int id = manager.selectId; |
| | | if (!manager.Has(type, id)) |
| | | return; |
| | | scrInfo.Refresh(); |
| | | int[] attrIDList = manager.GetAttrIDList(type, id); |
| | | int[] initAttrValueList = manager.GetInitAttrValueList(type, id); |
| | | if (!attrIDList.IsNullOrEmpty() && !initAttrValueList.IsNullOrEmpty() && attrIDList.Length == initAttrValueList.Length) |
| | | { |
| | | for (int i = 0; i < attrIDList.Length; i++) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = id; |
| | | scrInfo.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | scrInfo.Restart(); |
| | | } |
| | | |
| | | public void TabSetActive() |
| | | { |
| | | var list = manager.ShowItemList(PhantasmPavilionType.Title, 1); |
| | | btnTabType1.SetActive(!list.IsNullOrEmpty()); |
| | | list = manager.ShowItemList(PhantasmPavilionType.Title, 2); |
| | | btnTabType2.SetActive(!list.IsNullOrEmpty()); |
| | | } |
| | | |
| | | private void CreateTitleScroller() |
| | | { |
| | | PhantasmPavilionType type = PhantasmPavilionType.Title; |
| | | scrTitle.Refresh(); |
| | | int tabType = functionOrder + 1; |
| | | List<int> showItemList = manager.ShowItemList(type, tabType); |
| | | if (!showItemList.IsNullOrEmpty() && manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | { |
| | | int rowCount = (int)Math.Ceiling((double)showItemList.Count / rowCountMax); |
| | | for (int i = 0; i < rowCount; i++) |
| | | { |
| | | CellInfo cellInfo = new CellInfo(); |
| | | cellInfo.infoInt1 = tabType; |
| | | scrTitle.AddCell(ScrollerDataType.Header, i, cellInfo); |
| | | } |
| | | } |
| | | scrTitle.Restart(); |
| | | |
| | | int jumpIndex = manager.GetJumpIndex(type, tabType); |
| | | scrTitle.JumpIndex(jumpIndex); |
| | | } |
| | | |
| | | public void UpdateTimer(PhantasmPavilionType type, int id) |
| | | { |
| | | bool isUnlock = manager.IsUnlock(type, id); |
| | | bool isLimitTime = manager.IsLimitTime(type, id); |
| | | if (!isUnlock || !isLimitTime || !manager.TryGetInfo(type, id, out var info) || info.EndTime <= 0) |
| | | { |
| | | txtRemainingTime1.SetActive(false); |
| | | txtRemainingTime2.SetActive(false); |
| | | return; |
| | | } |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isCanStarAdd = manager.HasStarAddAttr(type, id); |
| | | |
| | | DateTime endDateTime = TimeUtility.OriginalTime.AddSeconds(info.EndTime); |
| | | TimeSpan remainingTime = endDateTime - TimeUtility.ServerNow; |
| | | int remainingSeconds = (int)remainingTime.TotalSeconds; |
| | | txtRemainingTime1.SetActive(state == PhantasmPavilionState.Activated && !isCanStarAdd && remainingSeconds > 0); |
| | | txtRemainingTime2.SetActive(state == PhantasmPavilionState.Activated && isCanStarAdd && remainingSeconds > 0); |
| | | if (remainingSeconds > 0) |
| | | { |
| | | string countdownText = TimeUtility.SecondsToShortDHMS(remainingSeconds); |
| | | txtRemainingTime1.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | txtRemainingTime2.text = Language.Get("PhantasmPavilion10", UIHelper.AppendColor(TextColType.LightGreen, countdownText)); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionTilteWin.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 8ece251320467ab4586b028a67812b60 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionTitleCell : MonoBehaviour |
| | | { |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Title; |
| | | [SerializeField] List<PhantasmPavilionTitleItem> items = new List<PhantasmPavilionTitleItem>(); |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int rowIndex,CellView cellView) |
| | | { |
| | | int tabType = cellView.info.Value.infoInt1; |
| | | List<int> showItemList = manager.ShowItemList(type, tabType); |
| | | if (showItemList.IsNullOrEmpty() || !manager.TryGetRowCountMax(type, out int rowCountMax)) |
| | | return; |
| | | for (int i = 0; i < items.Count; i++) |
| | | { |
| | | int index = rowIndex * rowCountMax + i; |
| | | if (!showItemList.IsNullOrEmpty()) |
| | | { |
| | | if (index < showItemList.Count) |
| | | { |
| | | items[i].SetActive(true); |
| | | items[i].Display(showItemList[index]); |
| | | } |
| | | else |
| | | { |
| | | items[i].SetActive(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionTitleCell.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 649c6e14e2e5e644e9ccab0eb1ea76b2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | |
| | | public class PhantasmPavilionTitleHandler : IPhantasmPavilionHandler |
| | | { |
| | | public bool HasTableKey(int id) |
| | | { |
| | | return TitleConfig.HasKey(id); |
| | | } |
| | | public List<int> GetKeyList() |
| | | { |
| | | return TitleConfig.GetKeys(); |
| | | } |
| | | public int GetResourceType(int id) |
| | | { |
| | | return TitleConfig.Get(id).ResourceType; |
| | | } |
| | | public string GetResourceValue(int id) |
| | | { |
| | | return TitleConfig.Get(id).ResourceValue; |
| | | } |
| | | |
| | | public string GetName(int id) |
| | | { |
| | | return TitleConfig.Get(id).Name; |
| | | } |
| | | public int GetExpireMinutes(int id) |
| | | { |
| | | return TitleConfig.Get(id).ExpireMinutes; |
| | | } |
| | | public int GetUnlockWay(int id) |
| | | { |
| | | return TitleConfig.Get(id).UnlockWay; |
| | | } |
| | | public int GetUnlockValue(int id) |
| | | { |
| | | return TitleConfig.Get(id).UnlockValue; |
| | | } |
| | | public int GetUnlockNeedCnt(int id) |
| | | { |
| | | return TitleConfig.Get(id).UnlockNeedCnt; |
| | | } |
| | | public int GetUpNeedCnt(int id) |
| | | { |
| | | return TitleConfig.Get(id).UpNeedCnt; |
| | | } |
| | | public int GetStarMax(int id) |
| | | { |
| | | return TitleConfig.Get(id).StarMax; |
| | | } |
| | | public int[] GetAttrIDList(int id) |
| | | { |
| | | return TitleConfig.Get(id).AttrIDList; |
| | | } |
| | | public int[] GetInitAttrValueList(int id) |
| | | { |
| | | return TitleConfig.Get(id).InitAttrValueList; |
| | | } |
| | | public int[] GetAttrPerStarAddList(int id) |
| | | { |
| | | return TitleConfig.Get(id).AttrPerStarAddList; |
| | | } |
| | | public string GetGetWayString(int id) |
| | | { |
| | | return TitleConfig.Get(id).GetWayString; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionTitleItem : MonoBehaviour |
| | | { |
| | | [SerializeField] ImageEx imgBg; |
| | | [SerializeField] ImageEx imgFace; |
| | | [SerializeField] UIFrame uiFrame; |
| | | [SerializeField] UIEffectPlayer spine; |
| | | [SerializeField] Button btnChoose; |
| | | |
| | | [SerializeField] ImageEx imgLimit; |
| | | [SerializeField] ImageEx imgLock; |
| | | [SerializeField] ImageEx imgChoose; |
| | | [SerializeField] ImageEx imgCanUnlock; |
| | | [SerializeField] Image imgUsing; |
| | | [SerializeField] Image imgRed; |
| | | |
| | | readonly PhantasmPavilionType type = PhantasmPavilionType.Title; |
| | | int id; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | this.id = id; |
| | | btnChoose.SetListener(() => |
| | | { |
| | | manager.selectId = id; |
| | | }); |
| | | |
| | | PhantasmPavilionState state = manager.GetUnLockState(type, id); |
| | | bool isLimitedTime = manager.IsLimitTime(type, id); |
| | | |
| | | bool isUsing = manager.IsUsing(type, id); |
| | | imgChoose.SetActive(manager.selectId == id); |
| | | imgBg.SetSprite(manager.selectId == id ? "ChatBoxSelect" : "ChatBoxUnSelect"); |
| | | imgLimit.SetActive(state == PhantasmPavilionState.Activated && isLimitedTime); |
| | | imgLock.SetActive(state != PhantasmPavilionState.Activated); |
| | | imgCanUnlock.SetActive(state == PhantasmPavilionState.CanActivate); |
| | | imgUsing.SetActive(state == PhantasmPavilionState.Activated && isUsing); |
| | | |
| | | int resourceType = manager.GetResourceType(type, id); |
| | | string resourceValue = manager.GetResourceValue(type, id); |
| | | manager.Show(imgFace, spine, uiFrame, resourceType, resourceValue); |
| | | if (resourceType == 1) |
| | | { |
| | | imgFace.SetNativeSize(); |
| | | } |
| | | |
| | | manager.UpdateItemRedPoint(imgRed, type, id); |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionTitleItem.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: e1a963588fc996342bc7cba8779c2b47 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class PhantasmPavilionUnlockButton : MonoBehaviour |
| | | { |
| | | [SerializeField] ButtonEx btnUnlock; |
| | | [SerializeField] ImageEx imgItem; |
| | | [SerializeField] TextEx txtCount; |
| | | [SerializeField] Image imgRed; |
| | | PhantasmPavilionType type; |
| | | int id; |
| | | int unlockWay; |
| | | int unlockValue; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | public void Display(int id) |
| | | { |
| | | type = manager.nowType; |
| | | this.id = id; |
| | | btnUnlock.SetListener(() => |
| | | { |
| | | if (unlockWay == 2) |
| | | { |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, unlockValue); |
| | | int useCnt = manager.GetUnlockNeedCnt(type, id); |
| | | if (useCnt > hasCnt) |
| | | { |
| | | if (!ItemConfig.HasKey(unlockValue)) |
| | | return; |
| | | string name = ItemConfig.Get(unlockValue).ItemName; |
| | | SysNotifyMgr.Instance.ShowTip("UnLockFail2", name); |
| | | return; |
| | | } |
| | | } |
| | | else if (unlockWay == 3) |
| | | { |
| | | bool hasHero = HeroManager.Instance.HasHero(unlockValue); |
| | | if (!hasHero) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("UnLockFail1"); |
| | | return; |
| | | } |
| | | } |
| | | manager.SendOPPack(type, PhantasmPavilionOperation.Activate, (uint)id); |
| | | SysNotifyMgr.Instance.ShowTip("UnLockSuccess"); |
| | | }); |
| | | |
| | | unlockWay = manager.GetUnlockWay(type, id); |
| | | unlockValue = manager.GetUnlockValue(type, id); |
| | | |
| | | txtCount.SetActive(unlockWay == 2); |
| | | imgRed.SetActive(false); |
| | | if (unlockWay == 2) |
| | | { |
| | | |
| | | if (!ItemConfig.HasKey(unlockValue)) |
| | | return; |
| | | ItemConfig itemConfig = ItemConfig.Get(unlockValue); |
| | | imgItem.SetSprite(itemConfig.IconKey); |
| | | |
| | | var hasCnt = PackManager.Instance.GetItemCountByID(PackType.Item, unlockValue); |
| | | int useCnt = manager.GetUnlockNeedCnt(type, id); |
| | | txtCount.text = UIHelper.AppendColor(useCnt <= hasCnt ? TextColType.Green : TextColType.Red, Language.Get("BoneField09", hasCnt, useCnt)); |
| | | imgRed.SetActive(useCnt <= hasCnt); |
| | | } |
| | | } |
| | | |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionUnlockButton.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: b97224cc7b76570489ab5cd011fddcc7 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | public class PhantasmPavilionWin : FunctionsBaseWin |
| | | { |
| | | [SerializeField] RedpointBehaviour[] rpTabArr; |
| | | [SerializeField] ImageEx imgModelBG; |
| | | PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } } |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | InitRedPoint(); |
| | | manager.UpdateRedPoint(); |
| | | } |
| | | |
| | | void InitRedPoint() |
| | | { |
| | | tabButtons[0].redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.Model); |
| | | tabButtons[1].redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.Face); |
| | | tabButtons[2].redpoint.redpointId = manager.GetRedpointId(PhantasmPavilionRepointType.Title); |
| | | } |
| | | |
| | | protected override void OpenSubUIByTabIndex() |
| | | { |
| | | imgModelBG.SetActive(functionOrder == 0); |
| | | switch (functionOrder) |
| | | { |
| | | case 0: |
| | | //形象 |
| | | currentSubUI = UIManager.Instance.OpenWindow<PhantasmPavilionModelWin>(); |
| | | manager.nowType = PhantasmPavilionType.Model; |
| | | break; |
| | | case 1: |
| | | //头像 |
| | | currentSubUI = UIManager.Instance.OpenWindow<PhantasmPavilionFaceWin>(); |
| | | manager.nowType = PhantasmPavilionType.Face; |
| | | break; |
| | | case 2: |
| | | //称号 |
| | | currentSubUI = UIManager.Instance.OpenWindow<PhantasmPavilionTitleWin>(); |
| | | manager.nowType = PhantasmPavilionType.Title; |
| | | break; |
| | | default: |
| | | Debug.LogWarning("未知的标签索引: " + functionOrder); |
| | | break; |
| | | } |
| | | } |
| | | } |
copy from Main/Config/Configs/PlayerFaceStarConfig.cs.meta
copy to Main/System/PhantasmPavilion/PhantasmPavilionWin.cs.meta
| File was copied from Main/Config/Configs/PlayerFaceStarConfig.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ccdffb3c82145e64cb12c26fccdfa818 |
| | | guid: 6278206cfd4de5e488b690982b22e8d1 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | |
| | | public class PlayerProfileWin : UIBase |
| | |
| | | GameAgeWarnWin.data = 2; |
| | | UIManager.Instance.OpenWindow<GameAgeWarnWin>(); |
| | | }); |
| | | avatarCell.redpoint.redpointId = MainRedDot.PhantasmPavilionRepoint; |
| | | avatarCell.button.SetListener(() => |
| | | { |
| | | UIManager.Instance.OpenWindow<PhantasmPavilionWin>(); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | RenameManager.Instance.OnUpdatePlayerNameCountEvent -= OnUpdatePlayerNameCount; |
| | | RenameManager.Instance.OnUpdateRenameResultEvent -= OnUpdateRenameResultEvent; |
| | | } |
| | | |
| | | private void OnUpdateRenameResultEvent() |
| | | { |
| | | Display(); |
| | |
| | | public const int BlessedLandRedpoint = 444; //淘金红点
|
| | | public const int CustomizedGiftRedpoint = 448; //自选礼包
|
| | | public const int LoginZhanLingRedpoint = 449; //登录战令
|
| | | public const int PhantasmPavilionRepoint = 459; //幻境阁
|
| | |
|
| | | public const int FairyEmbleManageRepoint = 462;//仙盟徽章管理入口红点
|
| | | public const int CycleHallRepoint = 463; //轮回殿
|
| | | public const int YunShiRepoint = 464; //运势
|
| | |
| | | public const int FirstChargeRepoint = 468; //首充
|
| | | public const int BoneFieldRepoint = 469; //白骨盈野
|
| | | public const int ArenaRepoint = 470; //演武场
|
| | | public const int TianziBillboradRepoint= 471; //天子的考验
|
| | | public const int TianziBillboradRepoint = 471; //天子的考验
|
| | | public const int PhantasmPavilionRepoint = 472; //幻境阁
|
| | | public void Register()
|
| | | {
|
| | |
|
| | |
| | | LuckValue = 101, //幸运值 101 |
| | | ExAttr1 = 102, //扩展属性1 102 主线已通关关卡 |
| | | ExAttr2 = 103, //扩展属性2 103 主线当前刷怪所在章节关卡记录 |
| | | ExAttr3 = 104, //扩展属性3 104元素攻击26 |
| | | ExAttr3 = 104, //扩展属性3 104 称号 |
| | | ExAttr4 = 105, //扩展属性4 105元素防御27 |
| | | ExAttr5 = 106, //扩展属性5 106 |
| | | Faction = 107, //阵营 107 |
| | |
| | | ExAttr7 = 115, //扩展属性7 法宝sp,非亿位 |
| | | ExAttr8 = 116, //扩展属性8 法宝sp,亿位 |
| | | ExAttr9 = 117, //扩展属性9 117控制抵抗34 |
| | | ExAttr10 = 118, //扩展属性10 118输出伤害35 |
| | | ModelMark = 119, //变形模型Mark 119 |
| | | ExAttr10 = 118, //扩展属性10 气泡 |
| | | ModelMark = 119, //变形模型Mark 119 形象 |
| | | PrizeCoin = 120, //奖励点券数 120 |
| | | ExAttr11 = 121, //扩展属性11 121 现金代币(代金券) |
| | | ExAttr12 = 122, //扩展属性12 记录离开信息,主动离开次数*100 + 被踢次数*10 + 最后一次是否主动离开的,暂时最多累计记录到9次 |