328 【主界面】坐骑系统
竞技场布阵的显隐
引导点战锤的时候不暂停游戏;引导的时候如果是功能开启,不显示战力变化避免遮挡
| | |
| | | typeof(GoldRushWorkerConfig),
|
| | | typeof(HeroLineupHaloConfig),
|
| | | typeof(HeroQualityLVConfig),
|
| | | typeof(HorseClassConfig),
|
| | | typeof(HorseSkinConfig),
|
| | | typeof(InvestConfig),
|
| | | typeof(ItemCompoundConfig),
|
| | | typeof(ItemConfig),
|
| | |
| | | ClearConfigDictionary<HeroLineupHaloConfig>();
|
| | | // 清空 HeroQualityLVConfig 字典
|
| | | ClearConfigDictionary<HeroQualityLVConfig>();
|
| | | // 清空 HorseClassConfig 字典
|
| | | ClearConfigDictionary<HorseClassConfig>();
|
| | | // 清空 HorseSkinConfig 字典
|
| | | ClearConfigDictionary<HorseSkinConfig>();
|
| | | // 清空 InvestConfig 字典
|
| | | ClearConfigDictionary<InvestConfig>();
|
| | | // 清空 ItemCompoundConfig 字典
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class HorseClassConfig : ConfigBase<int, HorseClassConfig>
|
| | | {
|
| | | static HorseClassConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int ClassLV;
|
| | | public int MaxLV;
|
| | | public int LVUPItemCnt;
|
| | | public int ClassUPItemCnt;
|
| | | public int[] ClassSpecAttrIDList;
|
| | | public int[] ClassSpecAttrValueList;
|
| | | public int[] AttrIDList;
|
| | | public int[] ClassAttrValueList;
|
| | | public int[] PerLVAttrValueList;
|
| | |
|
| | | 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 ClassLV); |
| | |
|
| | | int.TryParse(tables[1],out MaxLV); |
| | |
|
| | | int.TryParse(tables[2],out LVUPItemCnt); |
| | |
|
| | | int.TryParse(tables[3],out ClassUPItemCnt); |
| | |
|
| | | if (tables[4].Contains("[")) |
| | | { |
| | | ClassSpecAttrIDList = JsonMapper.ToObject<int[]>(tables[4]); |
| | | } |
| | | else |
| | | { |
| | | string[] ClassSpecAttrIDListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ClassSpecAttrIDList = new int[ClassSpecAttrIDListStringArray.Length]; |
| | | for (int i=0;i<ClassSpecAttrIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ClassSpecAttrIDListStringArray[i],out ClassSpecAttrIDList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[5].Contains("[")) |
| | | { |
| | | ClassSpecAttrValueList = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] ClassSpecAttrValueListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ClassSpecAttrValueList = new int[ClassSpecAttrValueListStringArray.Length]; |
| | | for (int i=0;i<ClassSpecAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ClassSpecAttrValueListStringArray[i],out ClassSpecAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[6].Contains("[")) |
| | | { |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[6]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrIDListStringArray = tables[6].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[7].Contains("[")) |
| | | { |
| | | ClassAttrValueList = JsonMapper.ToObject<int[]>(tables[7]); |
| | | } |
| | | else |
| | | { |
| | | string[] ClassAttrValueListStringArray = tables[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ClassAttrValueList = new int[ClassAttrValueListStringArray.Length]; |
| | | for (int i=0;i<ClassAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(ClassAttrValueListStringArray[i],out ClassAttrValueList[i]); |
| | | } |
| | | }
|
| | |
|
| | | if (tables[8].Contains("[")) |
| | | { |
| | | PerLVAttrValueList = JsonMapper.ToObject<int[]>(tables[8]); |
| | | } |
| | | else |
| | | { |
| | | string[] PerLVAttrValueListStringArray = tables[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | PerLVAttrValueList = new int[PerLVAttrValueListStringArray.Length]; |
| | | for (int i=0;i<PerLVAttrValueListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(PerLVAttrValueListStringArray[i],out PerLVAttrValueList[i]); |
| | | } |
| | | }
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 34c95a7471af1ee41ab1250f1bffdf9b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年11月16日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class HorseSkinConfig : ConfigBase<int, HorseSkinConfig>
|
| | | {
|
| | | static HorseSkinConfig()
|
| | | {
|
| | | // 访问过静态构造函数
|
| | | visit = true; |
| | | }
|
| | |
|
| | | public int SkinID;
|
| | | public string Name;
|
| | | 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 Icon;
|
| | |
|
| | | 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 SkinID); |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out ExpireMinutes); |
| | |
|
| | | int.TryParse(tables[3],out UnlockWay); |
| | |
|
| | | int.TryParse(tables[4],out UnlockValue); |
| | |
|
| | | int.TryParse(tables[5],out UnlockNeedCnt); |
| | |
|
| | | int.TryParse(tables[6],out UpNeedCnt); |
| | |
|
| | | int.TryParse(tables[7],out StarMax); |
| | |
|
| | | if (tables[8].Contains("[")) |
| | | { |
| | | AttrIDList = JsonMapper.ToObject<int[]>(tables[8]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrIDListStringArray = tables[8].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[9].Contains("[")) |
| | | { |
| | | InitAttrValueList = JsonMapper.ToObject<int[]>(tables[9]); |
| | | } |
| | | else |
| | | { |
| | | string[] InitAttrValueListStringArray = tables[9].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[10].Contains("[")) |
| | | { |
| | | AttrPerStarAddList = JsonMapper.ToObject<int[]>(tables[10]); |
| | | } |
| | | else |
| | | { |
| | | string[] AttrPerStarAddListStringArray = tables[10].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]); |
| | | } |
| | | }
|
| | |
|
| | | Icon = tables[11];
|
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9de30687da6d7154f92b7ca9e075a041 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | public partial class HorseClassConfig : ConfigBase<int, HorseClassConfig> |
| | | { |
| | | public static Dictionary<int, int> maxLVDict = new Dictionary<int, int>(); |
| | | protected override void OnConfigParseCompleted() |
| | | { |
| | | maxLVDict[ClassLV] = MaxLV; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 119ed7937af6c4b469b95744674b1adf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public int BasicsDefense;//基础防御 |
| | | public int BasicsScoreAHit;//基础命中 |
| | | public int BasicsDodge;//基础闪避 |
| | | public uint equipShowSwitch;//装备显隐开关 |
| | | public uint equipShowSwitch;//当前配置的坐骑外观ID存储在 个位数十位数(最大支持 1~99) |
| | | public int mater;//灵根属性——金 |
| | | public int wood;//灵根属性——木 |
| | | public int water;//灵根属性——水 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 01 坐骑升级 #tagCSHorseLVUP
|
| | |
|
| | | public class CB201_tagCSHorseLVUP : GameNetPackBasic {
|
| | | public byte IsQuick; // 是否快速升级,0-只消耗1个道具;1-消耗升1级的道具
|
| | |
|
| | | public CB201_tagCSHorseLVUP () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB201;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (IsQuick, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 307fd40df36bb1a42ac68c26cc5d2126 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 02 坐骑进阶 #tagCSHorseClassUP
|
| | |
|
| | | public class CB202_tagCSHorseClassUP : GameNetPackBasic {
|
| | |
|
| | | public CB202_tagCSHorseClassUP () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB202;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 6a711796d86b37b44b24f9c007d757db |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B2 03 坐骑外观操作 #tagCSHorseSkinOP
|
| | |
|
| | | public class CB203_tagCSHorseSkinOP : GameNetPackBasic {
|
| | | public byte OPType; // 操作 1-激活;2-佩戴;3-升星
|
| | | public byte SkinID; // 外观ID,佩戴时发0即为卸下
|
| | |
|
| | | public CB203_tagCSHorseSkinOP () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xB203;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (OPType, NetDataType.BYTE);
|
| | | WriteBytes (SkinID, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 03ba97a7c084f1348a751863109ada43 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 03 坐骑阶级信息 #tagSCHorseClassInfo
|
| | |
|
| | | public class DTCA303_tagSCHorseClassInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA303_tagSCHorseClassInfo vNetData = vNetPack as HA303_tagSCHorseClassInfo;
|
| | | HorseManager.Instance.UpdateHorseInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 88082cef50130fc4a8c19bbf1bb63acb |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 04 坐骑外观信息 #tagSCHorseSkinInfo
|
| | |
|
| | | public class DTCA304_tagSCHorseSkinInfo : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HA304_tagSCHorseSkinInfo vNetData = vNetPack as HA304_tagSCHorseSkinInfo;
|
| | | HorseManager.Instance.UpdateHorseSkinInfo(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 4bae730aac487da499cee86b1bcd9e82 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(HA30D_tagSCDaySignInfo), typeof(DTCA30D_tagSCDaySignInfo)); |
| | | Register(typeof(HA123_tagUpdatePlayerNameCount), typeof(DTCA123_tagUpdatePlayerNameCount)); |
| | | Register(typeof(HA921_tagSCRenameResult), typeof(DTCA921_tagSCRenameResult)); |
| | | Register(typeof(HA303_tagSCHorseClassInfo), typeof(DTCA303_tagSCHorseClassInfo)); |
| | | Register(typeof(HA304_tagSCHorseSkinInfo), typeof(DTCA304_tagSCHorseSkinInfo)); |
| | | } |
| | | |
| | | //主工程注册封包 |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 03 坐骑阶级信息 #tagSCHorseClassInfo
|
| | |
|
| | | public class HA303_tagSCHorseClassInfo : GameNetPackBasic {
|
| | | public byte ClassLV; //当前阶级,从0开始
|
| | | public ushort HorseLV; //当前阶等级,从1开始
|
| | | public ushort Exp; //当前阶等级经验,每级从0开始
|
| | |
|
| | | public HA303_tagSCHorseClassInfo () {
|
| | | _cmd = (ushort)0xA303;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ClassLV, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HorseLV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out Exp, vBytes, NetDataType.WORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f89267eabf7f9fa439d249ed50f43357 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // A3 04 坐骑外观信息 #tagSCHorseSkinInfo
|
| | |
|
| | | public class HA304_tagSCHorseSkinInfo : GameNetPackBasic {
|
| | | public byte Count;
|
| | | public tagSCHorseSkin[] HorseSkinList;
|
| | |
|
| | | public HA304_tagSCHorseSkinInfo () {
|
| | | _cmd = (ushort)0xA304;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Count, vBytes, NetDataType.BYTE);
|
| | | HorseSkinList = new tagSCHorseSkin[Count];
|
| | | for (int i = 0; i < Count; i ++) {
|
| | | HorseSkinList[i] = new tagSCHorseSkin();
|
| | | TransBytes (out HorseSkinList[i].HorseSkinID, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HorseSkinList[i].State, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out HorseSkinList[i].EndTime, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out HorseSkinList[i].Star, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public class tagSCHorseSkin {
|
| | | public byte HorseSkinID; //坐骑外观ID
|
| | | public byte State; //是否已激活
|
| | | public uint EndTime; //到期时间戳,0为永久
|
| | | public byte Star; //星级
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b1a61c4f381b1ac40b6e95ea776313e6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | managers.Add(SignManager.Instance);
|
| | | managers.Add(RenameManager.Instance);
|
| | | managers.Add(AchievementManager.Instance);
|
| | | managers.Add(HorseManager.Instance);
|
| | |
|
| | |
|
| | | foreach (var manager in managers)
|
| | | {
|
| | | manager.Init();
|
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public bool forceResumeGame = false; |
| | | //暂停的原因有很多,需要检查各种状态 |
| | | protected override bool CanResumeGame() |
| | | { |
| | | if (forceResumeGame) |
| | | { |
| | | //强制恢复 |
| | | forceResumeGame = false; |
| | | return true; |
| | | } |
| | | |
| | | if (NewBieCenter.Instance.IsPauseMainBattle(NewBieCenter.Instance.currentGuide)) |
| | | { |
| | | return false; |
| | |
| | | heroListScroller.OnRefreshCell += OnRefreshCell; |
| | | HeroUIManager.Instance.OnTeamPosChangeEvent += TeamChangeEvent; |
| | | TeamManager.Instance.OnTeamChange += OnTeamChange; |
| | | ShowFuncBtn(); |
| | | SelectTiltleBtn(); |
| | | CreateScroller(); |
| | | Display(); |
| | |
| | | TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType).RestoreTeam(); |
| | | } |
| | | |
| | | void ShowFuncBtn() |
| | | { |
| | | jjcBtn.SetActive(FuncOpen.Instance.IsFuncOpen(ArenaManager.Instance.DeployTroopsFuncId)); |
| | | } |
| | | |
| | | |
| | | void SelectTiltleBtn() |
| | | { |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 45b98c558c2c8674c9b8e7a879ac5ce9 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System;
|
| | | using LitJson;
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System.Linq;
|
| | |
|
| | | public class HorseManager : GameSystemManager<HorseManager>
|
| | | {
|
| | | public int classLV; //当前阶级,从0开始
|
| | | public int horseLV; //当前阶等级,从1开始
|
| | | public int exp; //当前阶等级经验,每级从0开始
|
| | | public event Action OnHorseUpdateEvent;
|
| | |
|
| | | public Dictionary<int, HorseSkin> skinDic = new Dictionary<int, HorseSkin>();
|
| | |
|
| | | //升级/升阶属性
|
| | | public Dictionary<int, long> specialAttrDic = new Dictionary<int, long>();
|
| | | public Dictionary<int, long> attrDic = new Dictionary<int, long>();
|
| | | public Dictionary<int, long> skinAttrDic = new Dictionary<int, long>();
|
| | |
|
| | | //配置
|
| | | public int lvUPItemID;
|
| | | public int rankUPItemID;
|
| | | public int quickRankLV;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitialize;
|
| | | PackManager.Instance.RefreshItemEvent += OnRefreshItemEvent;
|
| | |
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin -= OnBeforePlayerDataInitialize;
|
| | | PackManager.Instance.RefreshItemEvent -= OnRefreshItemEvent;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | | var config = FuncConfigConfig.Get("HorseUpItem");
|
| | | lvUPItemID = int.Parse(config.Numerical1);
|
| | | rankUPItemID = int.Parse(config.Numerical2);
|
| | | quickRankLV = int.Parse(config.Numerical3);
|
| | | }
|
| | |
|
| | | void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | classLV = 0;
|
| | | horseLV = 0;
|
| | | exp = 0;
|
| | | skinDic.Clear();
|
| | | }
|
| | |
|
| | | void OnRefreshItemEvent(PackType type, int index, int itemID)
|
| | | {
|
| | | if (type == PackType.Item)
|
| | | {
|
| | | if (itemID == lvUPItemID || itemID == rankUPItemID)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public int GetHorseSkinID()
|
| | | {
|
| | | return (int)PlayerDatas.Instance.baseData.equipShowSwitch%100;
|
| | | }
|
| | |
|
| | | public void UpdateHorseInfo(HA303_tagSCHorseClassInfo netPack)
|
| | | {
|
| | | classLV = netPack.ClassLV;
|
| | | horseLV = netPack.HorseLV;
|
| | | exp = netPack.Exp;
|
| | | UpdateRedpoint();
|
| | | RefreshAttr();
|
| | | OnHorseUpdateEvent?.Invoke();
|
| | | }
|
| | |
|
| | |
|
| | | public void UpdateHorseSkinInfo(HA304_tagSCHorseSkinInfo netPack)
|
| | | {
|
| | | for (int i = 0; i < netPack.HorseSkinList.Length; i++)
|
| | | {
|
| | | skinDic[netPack.HorseSkinList[i].HorseSkinID] = new HorseSkin()
|
| | | {
|
| | | State = netPack.HorseSkinList[i].State,
|
| | | EndTime = (int)netPack.HorseSkinList[i].EndTime,
|
| | | Star = netPack.HorseSkinList[i].Star
|
| | | };
|
| | | }
|
| | |
|
| | | RefreshSkinAttr();
|
| | | UpdateRedpoint();
|
| | | OnHorseUpdateEvent?.Invoke();
|
| | | }
|
| | |
|
| | | Redpoint redpoint = new Redpoint(MainRedDot.RedPoint_HorseKey);
|
| | | void UpdateRedpoint()
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | redpoint.state = RedPointState.None;
|
| | | var state = GetHorseState();
|
| | | if (state == 0)
|
| | | {
|
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, lvUPItemID) > 0)
|
| | | {
|
| | | redpoint.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | else if (state == 1)
|
| | | {
|
| | | var config = HorseClassConfig.Get(classLV);
|
| | | if (PackManager.Instance.GetItemCountByID(PackType.Item, rankUPItemID) >= config.ClassUPItemCnt)
|
| | | {
|
| | | redpoint.state = RedPointState.Simple;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //0 升级 1 升阶 2 满级
|
| | | public int GetHorseState()
|
| | | {
|
| | | if (HorseClassConfig.maxLVDict.TryGetValue(classLV, out int maxLV))
|
| | | {
|
| | | if (horseLV < maxLV)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | else if (horseLV >= maxLV)
|
| | | {
|
| | | if (classLV == HorseClassConfig.maxLVDict.Count - 1)
|
| | | {
|
| | | //从0阶级开始
|
| | | return 2;
|
| | | }
|
| | | return 1;
|
| | | }
|
| | | }
|
| | |
|
| | | return 2;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | public void RefreshAttr()
|
| | | {
|
| | | specialAttrDic.Clear();
|
| | | attrDic.Clear();
|
| | | for (int lv = 0; lv <= classLV; lv++)
|
| | | {
|
| | | //按阶加成
|
| | | var config = HorseClassConfig.Get(lv);
|
| | | if (!config.ClassSpecAttrIDList.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < config.ClassSpecAttrIDList.Length; i++)
|
| | | {
|
| | | if (!specialAttrDic.ContainsKey(config.ClassSpecAttrIDList[i]))
|
| | | {
|
| | | specialAttrDic[config.ClassSpecAttrIDList[i]] = 0;
|
| | | }
|
| | | specialAttrDic[config.ClassSpecAttrIDList[i]] += config.ClassSpecAttrValueList[i];
|
| | | }
|
| | | }
|
| | | |
| | | if (!config.ClassAttrValueList.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < config.AttrIDList.Length; i++)
|
| | | {
|
| | | if (!attrDic.ContainsKey(config.AttrIDList[i]))
|
| | | {
|
| | | attrDic[config.AttrIDList[i]] = 0;
|
| | | }
|
| | | attrDic[config.AttrIDList[i]] += config.ClassAttrValueList[i];
|
| | | }
|
| | | }
|
| | |
|
| | | //按等级加成
|
| | | if (!config.PerLVAttrValueList.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < config.AttrIDList.Length; i++)
|
| | | {
|
| | | if (!attrDic.ContainsKey(config.AttrIDList[i]))
|
| | | {
|
| | | attrDic[config.AttrIDList[i]] = 0;
|
| | | }
|
| | | var tmpHorseLV = lv != classLV ? config.MaxLV :horseLV;
|
| | |
|
| | | attrDic[config.AttrIDList[i]] += config.PerLVAttrValueList[i]*tmpHorseLV;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | //刷新皮肤属性
|
| | | void RefreshSkinAttr()
|
| | | {
|
| | | skinAttrDic.Clear();
|
| | | foreach(var skinID in skinDic.Keys)
|
| | | {
|
| | | var skin = skinDic[skinID];
|
| | | if (skin.State != 1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | |
| | | var config = HorseSkinConfig.Get(skinID);
|
| | | |
| | | if (config.AttrIDList.IsNullOrEmpty())
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (!config.InitAttrValueList.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < config.AttrIDList.Length; i++)
|
| | | {
|
| | | if (!skinAttrDic.ContainsKey(config.AttrIDList[i]))
|
| | | {
|
| | | skinAttrDic[config.AttrIDList[i]] = 0;
|
| | | }
|
| | | skinAttrDic[config.AttrIDList[i]] += config.InitAttrValueList[i];
|
| | | }
|
| | | }
|
| | | |
| | | if (!config.AttrPerStarAddList.IsNullOrEmpty())
|
| | | {
|
| | | for (int i = 0; i < config.AttrIDList.Length; i++)
|
| | | {
|
| | | if (!skinAttrDic.ContainsKey(config.AttrIDList[i]))
|
| | | {
|
| | | skinAttrDic[config.AttrIDList[i]] = 0;
|
| | | }
|
| | | skinAttrDic[config.AttrIDList[i]] += config.AttrPerStarAddList[i]*skin.Star;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public long GetAttrValue(int attrID)
|
| | | {
|
| | | attrDic.TryGetValue(attrID, out long value);
|
| | | specialAttrDic.TryGetValue(attrID, out long specialValue);
|
| | | skinAttrDic.TryGetValue(attrID, out long skinValue);
|
| | | return value + specialValue + skinValue;
|
| | | }
|
| | |
|
| | | public int GetAttrPer(int attrID)
|
| | | {
|
| | | if (PlayerPropertyConfig.baseAttr2perDict.ContainsKey(attrID))
|
| | | {
|
| | | var pertype = PlayerPropertyConfig.baseAttr2perDict[attrID];
|
| | | attrDic.TryGetValue(pertype, out long value);
|
| | | specialAttrDic.TryGetValue(pertype, out long specialValue);
|
| | | skinAttrDic.TryGetValue(pertype, out long skinValue);
|
| | |
|
| | | return (int)(value + specialValue + skinValue);
|
| | | }
|
| | |
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | public class HorseSkin {
|
| | | public int State; //是否已激活
|
| | | public int EndTime; //到期时间戳,0为永久
|
| | | public int Star; //星级
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2c615b4e07501fb46b22d715c8234def |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 坐骑升阶 |
| | | /// </summary> |
| | | public class HorseRankUPWin : UIBase |
| | | { |
| | | [SerializeField] Text curLVText; |
| | | [SerializeField] Text nextLVText; |
| | | [SerializeField] Text[] attrNameTexts; |
| | | [SerializeField] Text[] attrValueTexts; |
| | | [SerializeField] Text[] nextAttrValueTexts; |
| | | |
| | | [SerializeField] Transform[] specialAttrRect; |
| | | [SerializeField] Text[] specialAttrNameTexts; |
| | | [SerializeField] Text[] specialAttrValueTexts; |
| | | [SerializeField] Text[] specialNextAttrValueTexts; |
| | | |
| | | [SerializeField] Text costText; |
| | | [SerializeField] Image costItemImg; |
| | | [SerializeField] Button rankUpBtn; |
| | | |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | rankUpBtn.AddListener(HorseRankUpgrade); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | Display(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | curLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | nextLVText.text = Language.Get("Horse8", HorseManager.Instance.classLV + 1, 1); |
| | | |
| | | var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV + 1); |
| | | |
| | | var keys = HorseManager.Instance.attrDic.Keys.ToList(); |
| | | keys.Sort(); |
| | | for (int i = 0; i < attrNameTexts.Length; i++) |
| | | { |
| | | if (i < keys.Count) |
| | | { |
| | | attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name; |
| | | attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]); |
| | | nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextConfig.ClassAttrValueList[i]); |
| | | } |
| | | } |
| | | |
| | | var nextKeys = HorseManager.Instance.specialAttrDic.Keys.ToList(); |
| | | nextKeys.Sort(); |
| | | for (int i = 0; i < specialAttrRect.Length; i++) |
| | | { |
| | | if (i < nextConfig.ClassSpecAttrIDList.Length) |
| | | { |
| | | specialAttrRect[i].SetActive(true); |
| | | specialAttrNameTexts[i].text = PlayerPropertyConfig.Get(nextKeys[i]).Name; |
| | | if (i < nextKeys.Count) |
| | | { |
| | | specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]]); |
| | | specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextConfig.ClassSpecAttrIDList[i], HorseManager.Instance.specialAttrDic[nextKeys[i]] + nextConfig.ClassSpecAttrValueList[i]); |
| | | } |
| | | else |
| | | { |
| | | specialAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], 0); |
| | | specialNextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(nextKeys[i], nextConfig.ClassSpecAttrValueList[i]); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | specialAttrRect[i].SetActive(false); |
| | | } |
| | | } |
| | | |
| | | costText.text = UIHelper.ShowUseItem(PackType.Item, HorseManager.Instance.rankUPItemID, HorseClassConfig.Get(HorseManager.Instance.classLV).ClassUPItemCnt); |
| | | costItemImg.SetItemSprite(HorseManager.Instance.rankUPItemID); |
| | | |
| | | } |
| | | |
| | | //升阶 |
| | | private void HorseRankUpgrade() |
| | | { |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt, 2)) |
| | | { |
| | | return; |
| | | } |
| | | var pack = new CB202_tagCSHorseClassUP(); |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | CloseWindow(); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0ae1b250abb65174f8b4339eaf2fb07c |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 坐骑外观 |
| | | /// </summary> |
| | | public class HorseSkinWin : UIBase |
| | | { |
| | | [SerializeField] Button bagBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 870a2b37a79a6fb4fb0a48fcb49f68c2 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 坐骑 |
| | | /// </summary> |
| | | public class HorseSuccessWin : UIBase |
| | | { |
| | | [SerializeField] Button bagBtn; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1a1c15106e63f6a4fa32cf0f8724c6f4 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | /// <summary> |
| | | /// 坐骑 |
| | | /// </summary> |
| | | public class HorseWin : UIBase |
| | | { |
| | | [SerializeField] Image modelImg; |
| | | [SerializeField] UIEffectPlayer lvUPEffect; |
| | | [SerializeField] Text nameText; |
| | | [SerializeField] Text specialAttrText; |
| | | [SerializeField] Button skinBtn; |
| | | [SerializeField] Text[] attrNameTexts; |
| | | [SerializeField] Text[] attrValueTexts; |
| | | [SerializeField] Text[] nextAttrValueTexts; |
| | | [SerializeField] Text lvText; |
| | | [SerializeField] Image processImg; |
| | | [SerializeField] Text processText; |
| | | [SerializeField] Transform fullRect; |
| | | [SerializeField] Text costText; |
| | | [SerializeField] Image costItemImg; |
| | | [SerializeField] LongPressButton lvupBtn; //升级/升阶按钮 |
| | | [SerializeField] Toggle quickUpToggle; |
| | | [SerializeField] Text needUPText; |
| | | [SerializeField] Button rankUpBtn; |
| | | |
| | | |
| | | |
| | | int beforeLV; |
| | | |
| | | protected override void InitComponent() |
| | | { |
| | | skinBtn.AddListener(()=>{ UIManager.Instance.OpenWindow<HorseSkinWin>();}); |
| | | lvupBtn.AddListener(HorseUpgrade); |
| | | lvupBtn.onPress.AddListener(HorseUpgrade); |
| | | quickUpToggle.onValueChanged.AddListener((bool value)=>{ OnToggle(value);}); |
| | | rankUpBtn.AddListener(HorseRankUpgrade); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | beforeLV = HorseManager.Instance.horseLV; |
| | | //默认勾选 |
| | | quickUpToggle.isOn = !LocalSave.GetBool("HorseQuickUp" + PlayerDatas.Instance.baseData.PlayerID); |
| | | HorseManager.Instance.OnHorseUpdateEvent += OnHorseUpdateEvent; |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | HorseManager.Instance.OnHorseUpdateEvent -= OnHorseUpdateEvent; |
| | | } |
| | | |
| | | void OnHorseUpdateEvent() |
| | | { |
| | | if (beforeLV != HorseManager.Instance.horseLV) |
| | | { |
| | | beforeLV = HorseManager.Instance.horseLV; |
| | | lvUPEffect.Play(); |
| | | } |
| | | Display(); |
| | | } |
| | | //升级 |
| | | private void HorseUpgrade() |
| | | { |
| | | bool isQuick = false; |
| | | if (HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV && quickUpToggle.isOn) |
| | | { |
| | | isQuick = true; |
| | | } |
| | | |
| | | if (!ItemLogicUtility.CheckItemCount(PackType.Item, HorseManager.Instance.lvUPItemID, 1, 2)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var pack = new CB201_tagCSHorseLVUP(); |
| | | pack.IsQuick = (byte)(isQuick ? 1 : 0); |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | } |
| | | |
| | | |
| | | //升阶 |
| | | private void HorseRankUpgrade() |
| | | { |
| | | // var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | // if (!ItemLogicUtility.CheckItemCount(PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt, 2)) |
| | | // { |
| | | // return; |
| | | // } |
| | | // var pack = new CB202_tagCSHorseClassUP(); |
| | | // GameNetSystem.Instance.SendInfo(pack); |
| | | UIManager.Instance.OpenWindow<HorseRankUPWin>(); |
| | | } |
| | | |
| | | void Display() |
| | | { |
| | | var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetHorseSkinID()); |
| | | modelImg.SetOrgSprite(skinConfig.Icon, "Horse"); |
| | | nameText.text = skinConfig.Name; |
| | | specialAttrText.text = GetSpecialAttr(); |
| | | |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | lvText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | processImg.fillAmount = HorseManager.Instance.exp / (float)config.LVUPItemCnt; |
| | | processText.text = HorseManager.Instance.exp + "/" + config.LVUPItemCnt; |
| | | |
| | | needUPText.text = Language.Get("Horse7", config.MaxLV - HorseManager.Instance.horseLV); |
| | | var state = HorseManager.Instance.GetHorseState(); |
| | | if (state == 0) |
| | | { |
| | | fullRect.SetActive(false); |
| | | costText.SetActive(true); |
| | | int useCnt = 1; |
| | | if (HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV && quickUpToggle.isOn) |
| | | { |
| | | useCnt = config.LVUPItemCnt - HorseManager.Instance.exp; |
| | | } |
| | | costText.text = UIHelper.ShowUseItem(PackType.Item, HorseManager.Instance.lvUPItemID, useCnt); |
| | | costItemImg.SetItemSprite(HorseManager.Instance.lvUPItemID); |
| | | lvupBtn.SetActive(true); |
| | | quickUpToggle.SetActive(HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV); |
| | | rankUpBtn.SetActive(false); |
| | | |
| | | processImg.fillAmount = HorseManager.Instance.exp / (float)config.LVUPItemCnt; |
| | | processText.text = HorseManager.Instance.exp + "/" + config.LVUPItemCnt; |
| | | } |
| | | else if (state == 1) |
| | | { |
| | | fullRect.SetActive(false); |
| | | lvupBtn.SetActive(false); |
| | | rankUpBtn.SetActive(true); |
| | | costText.SetActive(true); |
| | | costText.text = UIHelper.ShowUseItem(PackType.Item, HorseManager.Instance.rankUPItemID, config.ClassUPItemCnt); |
| | | costItemImg.SetItemSprite(HorseManager.Instance.rankUPItemID); |
| | | quickUpToggle.SetActive(false); |
| | | processImg.fillAmount = 1; |
| | | processText.text = ""; |
| | | } |
| | | else |
| | | { |
| | | fullRect.SetActive(true); |
| | | lvupBtn.SetActive(false); |
| | | rankUpBtn.SetActive(false); |
| | | costText.SetActive(false); |
| | | quickUpToggle.SetActive(false); |
| | | processImg.fillAmount = 1; |
| | | processText.text = ""; |
| | | } |
| | | |
| | | |
| | | var keys = HorseManager.Instance.attrDic.Keys.ToList(); |
| | | keys.Sort(); |
| | | //满级 和下级属性 |
| | | var nextConfig = HorseClassConfig.Get(HorseManager.Instance.classLV + 1); |
| | | var nextAttr = state == 1 ? nextConfig.ClassAttrValueList : (state == 0 ? config.PerLVAttrValueList : new int[config.AttrIDList.Length]); |
| | | for (int i = 0; i < attrNameTexts.Length; i++) |
| | | { |
| | | if (i < keys.Count) |
| | | { |
| | | attrNameTexts[i].text = PlayerPropertyConfig.Get(keys[i]).Name; |
| | | attrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], HorseManager.Instance.attrDic[keys[i]]); |
| | | nextAttrValueTexts[i].text = PlayerPropertyConfig.GetValueDescription(keys[i], nextAttr[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | string GetSpecialAttr() |
| | | { |
| | | List<string> attrList = new List<string>(); |
| | | foreach(var attrID in HorseManager.Instance.specialAttrDic.Keys) |
| | | { |
| | | attrList.Add(UIHelper.AppendColor(TextColType.itemchuanqi, PlayerPropertyConfig.GetFullDescription(attrID, HorseManager.Instance.specialAttrDic[attrID]))); |
| | | } |
| | | return Language.Get("L1100", Language.Get("herocard55"), string.Join(Language.Get("L1112"), attrList)); |
| | | } |
| | | |
| | | void OnToggle(bool value) |
| | | { |
| | | LocalSave.SetBool("HorseQuickUp" + PlayerDatas.Instance.baseData.PlayerID, !quickUpToggle.isOn); |
| | | var config = HorseClassConfig.Get(HorseManager.Instance.classLV); |
| | | var state = HorseManager.Instance.GetHorseState(); |
| | | if (state == 0) |
| | | { |
| | | int useCnt = 1; |
| | | if (HorseManager.Instance.classLV >= HorseManager.Instance.quickRankLV && quickUpToggle.isOn) |
| | | { |
| | | useCnt = config.LVUPItemCnt - HorseManager.Instance.exp; |
| | | } |
| | | costText.text = UIHelper.ShowUseItem(PackType.Item, HorseManager.Instance.lvUPItemID, useCnt); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 52a19eb03ce76e540982134e076a51e9 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //等级属性 |
| | | void RefreshLVAttrs() |
| | | { |
| | | // lvAttrs.Clear(); |
| | | lvAttrs.Clear(); |
| | | var playerLVConfig = PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV); |
| | | foreach (var attrType in PlayerPropertyConfig.baseAttrs) |
| | | { |
| | |
| | | //官职属性 |
| | | void RefreshOfficialAttrs() |
| | | { |
| | | // officialAttrs.Clear(); |
| | | officialAttrs.Clear(); |
| | | var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel); |
| | | for (int i = 0; i < config.AddAttrType.Length; i++) |
| | | { |
| | |
| | | // 单基础属性计算 |
| | | public double GetPropertyVaule(int attrType, HeroInfo hero, string formula) |
| | | { |
| | | // propertyVariables.Clear(); |
| | | propertyVariables.Clear(); |
| | | propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0; |
| | | propertyVariables["equipValue"] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0; |
| | | propertyVariables["bookValue"] = 0; |
| | |
| | | |
| | | public double GetPropertyVaule(int attrType, HeroInfo hero, int type) |
| | | { |
| | | // propertyVariables.Clear(); |
| | | propertyVariables.Clear(); |
| | | propertyVariables["lvValue"] = lvAttrs.ContainsKey(attrType) ? lvAttrs[attrType] : 0; |
| | | propertyVariables["equipValue"] = equipAttrs.ContainsKey(attrType) ? equipAttrs[attrType] : 0; |
| | | propertyVariables["bookValue"] = 0; |
| | |
| | | propertyVariables["gubaoPer"] = 0; |
| | | propertyVariables["hjgValue"] = 0; |
| | | propertyVariables["hjgPer"] = 0; |
| | | propertyVariables["horseValue"] = 0; |
| | | propertyVariables["horsePer"] = 0; |
| | | propertyVariables["horseValue"] = HorseManager.Instance.GetAttrValue(attrType); |
| | | propertyVariables["horsePer"] = HorseManager.Instance.GetAttrPer(attrType) / 10000.0f; |
| | | |
| | | //!!!单武将战力预览的话需要排除队伍影响战力,只算武将自身的上阵属性 |
| | | propertyVariables["lineupInitAddPer"] = GetLineUpPer(attrType, "lineupInitAddPer") / 10000.0f; |
| | |
| | | |
| | | [SerializeField] Button FirstChargeBtn; |
| | | |
| | | //坐骑 |
| | | [SerializeField] Image horseBGImg; |
| | | [SerializeField] Button horseBtn; |
| | | [SerializeField] Image horseImg; |
| | | [SerializeField] Text horseLVText; |
| | | |
| | | /// <summary> |
| | | /// 初始化组件 |
| | | /// </summary> |
| | |
| | | { |
| | | rightFuncInHome.ShowFuncCol(true); |
| | | }); |
| | | |
| | | horseBtn.AddListener(OpenHorse); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | funcColBtn.SetActive(FuncOpen.Instance.IsFuncOpen(GeneralDefine.mainRightFuncOpenFuncID)); |
| | | officialTip.SetActive(OfficialRankManager.Instance.CanOfficialLVUP()); |
| | | |
| | | DisplayHorse(); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | { |
| | | funcColBtn.SetActive(FuncOpen.Instance.IsFuncOpen(GeneralDefine.mainRightFuncOpenFuncID)); |
| | | } |
| | | else if (funcId == (int)FuncOpenEnum.Horse) |
| | | { |
| | | DisplayHorse(); |
| | | } |
| | | } |
| | | |
| | | private void OnUpdateFirstChargeInfo() |
| | |
| | | { |
| | | DisplayCard(TeamType.Story); |
| | | } |
| | | |
| | | |
| | | void DisplayHorse() |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse)) |
| | | { |
| | | horseBGImg.SetActive(true); |
| | | //equipShowSwitch;//当前配置的坐骑外观ID存储在 个位数十位数(最大支持 1~99) |
| | | var skinConfig = HorseSkinConfig.Get(HorseManager.Instance.GetHorseSkinID()); |
| | | horseImg.SetOrgSprite(skinConfig.Icon, "Horse"); |
| | | horseLVText.text = Language.Get("Horse8",HorseManager.Instance.classLV, HorseManager.Instance.horseLV); |
| | | } |
| | | else |
| | | { |
| | | horseBGImg.SetActive(false); |
| | | } |
| | | } |
| | | |
| | | void OpenHorse() |
| | | { |
| | | if (FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse, true)) |
| | | { |
| | | UIManager.Instance.OpenWindow<HorseWin>(); |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | public void PowerAdd(long power)
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding)
|
| | | if (UIManager.Instance.IsOpened<NewBieWin>() )
|
| | | {
|
| | | if (UIManager.Instance.GetUI<NewBieWin>().IsFuncOpenGuide())
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | if (prowBool)
|
| | | {
|
| | |
| | | return GuideConfig.Get(_id).PauseMainBattle == 1;
|
| | | }
|
| | |
|
| | | public void ResumeGame()
|
| | | {
|
| | | BattleManager.Instance.storyBattleField.forceResumeGame = true;
|
| | | BattleManager.Instance.storyBattleField.IsPause = false;
|
| | | }
|
| | |
|
| | | //非0代表 可重复引导,且优先级低会被新引导替换,且不暂停主线战斗
|
| | | public bool IsNeedRecord(int _id)
|
| | | {
|
| | |
| | | return id;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | public enum GuideTriggerType
|
| | |
| | | CloseWindow();
|
| | | return;
|
| | | }
|
| | | if (stepConfig.guideType == GuideType.Function)
|
| | | {
|
| | | UIManager.Instance.CloseWindow<PowerAddWin>();
|
| | | }
|
| | |
|
| | | Debug.Log($"引导ID:{NewBieCenter.Instance.currentGuide} 引导步骤:{step}");
|
| | |
|
| | | lastShowTime = Time.time;
|
| | |
|
| | | //避免弹装备界面和引导冲突
|
| | | if (config.WinName != "EquipExchangeWin" && UIManager.Instance.IsOpened<EquipExchangeWin>())
|
| | | {
|
| | | UIManager.Instance.CloseWindow<EquipExchangeWin>();
|
| | | }
|
| | |
|
| | | //引导的是战斗 解除暂停
|
| | | if (stepConfig.UIElementPath.Contains("HomeBtn") && UIManager.Instance.IsOpened<HomeWin>())
|
| | | {
|
| | | NewBieCenter.Instance.ResumeGame();
|
| | | }
|
| | |
|
| | | try
|
| | |
| | | return UIManager.Instance.GetUIRoot().transform.Find(path);
|
| | | }
|
| | |
|
| | | public bool IsFuncOpenGuide()
|
| | | {
|
| | | if (stepConfig == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
|
| | | return stepConfig.guideType == GuideType.Function ;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | //签到
|
| | | public const int RedPoint_SignKey = 107;
|
| | |
|
| | |
|
| | | //坐骑
|
| | | public const int RedPoint_HorseKey = 108;
|
| | |
|
| | | //武将卡
|
| | | public const int HeroCardRedpoint = 200;
|
| | |
| | | Chat = 19,//聊天 |
| | | AutoFight = 20,//自动战斗 |
| | | Recharge = 22,//充值 |
| | | Horse = 37, //坐骑 |
| | | BattlePass = 40, //基金(战令) |
| | | LLMJ = 41, //历练秘笈 |
| | | |