指挥官技能养成重构
parent
a384e6967e
commit
48b563a6c2
BIN
ProjectNLD/Assets/Art/UI/Fonts/SourceHanSansCN-Medium SDF.asset (Stored with Git LFS)
BIN
ProjectNLD/Assets/Art/UI/Fonts/SourceHanSansCN-Medium SDF.asset (Stored with Git LFS)
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -481,8 +481,11 @@ public partial class UIManager : Singlenton<UIManager>, IInitable, IUpdatable
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
//关掉所有Normal层已打开的界面,保留传参的界面
|
||||
|
||||
/// <summary>
|
||||
/// 关掉所有Normal层已打开的界面,保留传参的界面
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
public void CloseAllNormalExcept(string path)
|
||||
{
|
||||
var windowsL = _GetLayerWindowList(UIWindowLayer.Normal);
|
||||
|
|
|
|||
|
|
@ -47,15 +47,23 @@ namespace Gameplay.Net
|
|||
m_SkillLevels[nSkillID] = nLevel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据技能id获取技能等级
|
||||
/// </summary>
|
||||
/// <param name="skillId"></param>
|
||||
/// <returns></returns>
|
||||
public int GetLevel(int skillId)
|
||||
{
|
||||
uint level = 0;
|
||||
if (m_SkillLevels.TryGetValue((uint)skillId,out level))
|
||||
{
|
||||
if (m_SkillLevels.TryGetValue((uint)skillId,out uint level))
|
||||
return (int)level;
|
||||
}
|
||||
|
||||
return (int)level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有技能等级之和
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetSumLevel()
|
||||
{
|
||||
int sumLv = 0;
|
||||
|
|
@ -63,7 +71,24 @@ namespace Gameplay.Net
|
|||
{
|
||||
sumLv += (int)m_SkillLevels[val];
|
||||
}
|
||||
|
||||
return sumLv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取已经解锁的技能id列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<int> GetSkillIds()
|
||||
{
|
||||
List<int> listSkillId = new(m_SkillLevels.Count);
|
||||
foreach(var skill in m_SkillLevels)
|
||||
{
|
||||
if (skill.Value > 0) // 等级大于0就是已经解锁的技能
|
||||
listSkillId.Add((int)skill.Key);
|
||||
}
|
||||
|
||||
return listSkillId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,11 +166,14 @@ namespace Gameplay.Net
|
|||
NetManager.Instance.mClient.SendMessage(msg);
|
||||
}
|
||||
|
||||
// 升级指挥官技能
|
||||
/// <summary>
|
||||
/// 升级指挥官技能
|
||||
/// </summary>
|
||||
/// <param name="nSkillID"></param>
|
||||
public static void PlayerSkillUpgrade(uint nSkillID)
|
||||
{
|
||||
MSG_Clt_G_PlayerSkillUpgrade msg =
|
||||
NetManager.Instance.GetMessage(NLDMID.MSGID.CltGPlayerSkillUpgrade) as MSG_Clt_G_PlayerSkillUpgrade;
|
||||
NetManager.Instance.GetMessage(MSGID.CltGPlayerSkillUpgrade) as MSG_Clt_G_PlayerSkillUpgrade;
|
||||
msg.mPB.SkillId = nSkillID;
|
||||
NetManager.Instance.mClient.SendMessage(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,39 +10,46 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using PhxhSDK;
|
||||
using Constants = Framework.Constants;
|
||||
using cfg.CharacterCfg;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家技能等级解锁数据
|
||||
/// </summary>
|
||||
public class PlayerSkillUnlockLevelData : Singlenton<PlayerSkillUnlockLevelData>
|
||||
{
|
||||
public int unlockLayer;
|
||||
public Dictionary<int,int>lockLayerDic= new Dictionary<int,int>();
|
||||
public int unlockLayer;
|
||||
public Dictionary<int, int> lockLayerDic = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 玩家技能升级帮助类
|
||||
/// </summary>
|
||||
public static class PlayerSkillUpgradeHelper
|
||||
{
|
||||
public static int GetMaxLevel(int id)
|
||||
{
|
||||
int maxLevel = 0;
|
||||
for (int i = 0; i <TableManager.Instance.Tables.PlayerSkillUpgrade.DataList.Count ; i++)
|
||||
for (int i = 0; i < TableManager.Instance.Tables.PlayerSkillUpgrade.DataList.Count; i++)
|
||||
{
|
||||
DataPlayerSkillUpgrade data = TableManager.Instance.Tables.PlayerSkillUpgrade.DataList[i];
|
||||
if (data.Level>maxLevel)
|
||||
if (data.Level > maxLevel)
|
||||
{
|
||||
maxLevel = data.Level;
|
||||
}
|
||||
}
|
||||
|
||||
return maxLevel;
|
||||
}
|
||||
|
||||
public static int GetSumLevel()
|
||||
public static int GetSumLevel()
|
||||
{
|
||||
return Actor.Instance.PlayerSkill.GetSumLevel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个玩家技能养成数据
|
||||
/// </summary>
|
||||
public class SinglePlayerSkillCultivateData
|
||||
{
|
||||
public int ID;
|
||||
|
|
@ -132,6 +139,9 @@ public class SinglePlayerSkillCultivateData
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 玩家每层养成数据
|
||||
/// </summary>
|
||||
public class PlayerLayerCultivateData
|
||||
{
|
||||
public List<SinglePlayerSkillCultivateData> dataList;
|
||||
|
|
@ -164,104 +174,120 @@ public class PlayerLayerCultivateData
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 玩家技能类型数据
|
||||
/// </summary>
|
||||
public class PlayerSkillTypeData
|
||||
{
|
||||
public int MaxLayer => maxLayer;
|
||||
/// <summary>
|
||||
/// 最大层数
|
||||
/// </summary>
|
||||
private int maxLayer;
|
||||
/// <summary>
|
||||
/// 玩家技能类型
|
||||
/// </summary>
|
||||
private PlayerSkillType playerSkillType;
|
||||
|
||||
public PlayerSkillType nowType;
|
||||
/// <summary>
|
||||
/// 玩家技能类型
|
||||
/// </summary>
|
||||
public PlayerSkillType SkillType
|
||||
{
|
||||
get { return playerSkillType; }
|
||||
}
|
||||
|
||||
public Dictionary<int, PlayerLayerCultivateData> layerDataDic = new Dictionary<int, PlayerLayerCultivateData>();
|
||||
/// <summary>
|
||||
/// 最大层数
|
||||
/// </summary>
|
||||
public int MaxLayer
|
||||
{
|
||||
get { return maxLayer; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 层数据字典,key:第几层 value:该层数据
|
||||
/// </summary>
|
||||
public Dictionary<int, PlayerLayerCultivateData> dicLayerData = new();
|
||||
|
||||
/// <summary>
|
||||
/// 根据层数获取该层数据
|
||||
/// </summary>
|
||||
/// <param name="layer"></param>
|
||||
/// <returns></returns>
|
||||
public PlayerLayerCultivateData GetDataByLayer(int layer)
|
||||
{
|
||||
PlayerLayerCultivateData data;
|
||||
if (layerDataDic.TryGetValue(layer, out data))
|
||||
{
|
||||
if (dicLayerData.TryGetValue(layer, out PlayerLayerCultivateData data))
|
||||
return data;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public PlayerSkillTypeData()
|
||||
{
|
||||
InitData();
|
||||
}
|
||||
void InitData()
|
||||
{
|
||||
maxLayer = 0;
|
||||
}
|
||||
|
||||
|
||||
public void Add(DataPlayerSkillUpgrade data)
|
||||
{
|
||||
PlayerLayerCultivateData player;
|
||||
if (layerDataDic.TryGetValue(data.LayerID, out player))
|
||||
{
|
||||
player.Add(data);
|
||||
}
|
||||
if (dicLayerData.TryGetValue(data.LayerID, out PlayerLayerCultivateData playerLayerCultivateData))
|
||||
playerLayerCultivateData.Add(data);
|
||||
else
|
||||
{
|
||||
|
||||
PlayerLayerCultivateData temp = new PlayerLayerCultivateData(data);
|
||||
temp.Add(data);
|
||||
layerDataDic.Add(data.LayerID, temp);
|
||||
playerLayerCultivateData = new PlayerLayerCultivateData(data);
|
||||
playerLayerCultivateData.Add(data);
|
||||
dicLayerData.Add(data.LayerID, playerLayerCultivateData);
|
||||
RefreshMaxLayer(data.LayerID);
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshMaxLayer(int layerID)
|
||||
{
|
||||
if(layerID>maxLayer)
|
||||
{
|
||||
if (layerID > maxLayer)
|
||||
maxLayer = layerID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 所有玩家技能养成数据
|
||||
/// </summary>
|
||||
public class AllPlayerSkillCultivateData
|
||||
{
|
||||
//layer 的dic
|
||||
private Dictionary<PlayerSkillType, PlayerSkillTypeData> playerTypeDic;
|
||||
/// <summary>
|
||||
/// 玩家技能类型对应技能数据字典
|
||||
/// </summary>
|
||||
private readonly Dictionary<PlayerSkillType, PlayerSkillTypeData> dicPlayerSkillTypeData;
|
||||
public Dictionary<int, SinglePlayerSkillCultivateData> allSinglePlayerDic;
|
||||
|
||||
public int maxLayer;
|
||||
|
||||
public PlayerSkillTypeData GetDataBySkillType(PlayerSkillType playerSkillType)
|
||||
{
|
||||
PlayerSkillTypeData data;
|
||||
if(playerTypeDic.TryGetValue(playerSkillType,out data))
|
||||
{
|
||||
if (dicPlayerSkillTypeData.TryGetValue(playerSkillType, out PlayerSkillTypeData data))
|
||||
return data;
|
||||
}
|
||||
|
||||
DebugUtil.LogError("数据有问题");
|
||||
return null;
|
||||
}
|
||||
|
||||
public AllPlayerSkillCultivateData()
|
||||
{
|
||||
playerTypeDic = new Dictionary<PlayerSkillType, PlayerSkillTypeData>();
|
||||
dicPlayerSkillTypeData = new Dictionary<PlayerSkillType, PlayerSkillTypeData>();
|
||||
allSinglePlayerDic = new Dictionary<int, SinglePlayerSkillCultivateData>();
|
||||
for (int i = 0; i < TableManager.Instance.Tables.PlayerSkillUpgrade.DataList.Count; i++)
|
||||
foreach (DataPlayerSkillUpgrade skillUpgradeData in TableManager.Instance.Tables.PlayerSkillUpgrade.DataList)
|
||||
{
|
||||
DataPlayerSkillUpgrade data = TableManager.Instance.Tables.PlayerSkillUpgrade.DataList[i];
|
||||
PlayerSkillTypeData player;
|
||||
if(playerTypeDic.TryGetValue(data.SkillType,out player))
|
||||
if (dicPlayerSkillTypeData.TryGetValue(skillUpgradeData.SkillType, out PlayerSkillTypeData player))
|
||||
player.Add(skillUpgradeData);
|
||||
else
|
||||
{
|
||||
player.Add(data);
|
||||
}else
|
||||
{
|
||||
PlayerSkillTypeData temp = new PlayerSkillTypeData();
|
||||
temp.Add(data);
|
||||
playerTypeDic.Add(data.SkillType, temp);
|
||||
|
||||
PlayerSkillTypeData temp = new();
|
||||
temp.Add(skillUpgradeData);
|
||||
dicPlayerSkillTypeData.Add(skillUpgradeData.SkillType, temp);
|
||||
}
|
||||
|
||||
SinglePlayerSkillCultivateData data1 = new SinglePlayerSkillCultivateData(data);
|
||||
if(!allSinglePlayerDic.ContainsKey(data.ID))
|
||||
{
|
||||
allSinglePlayerDic.Add(data.ID, data1);
|
||||
|
||||
}
|
||||
SinglePlayerSkillCultivateData data = new(skillUpgradeData);
|
||||
if(!allSinglePlayerDic.ContainsKey(skillUpgradeData.ID))
|
||||
allSinglePlayerDic.Add(skillUpgradeData.ID, data);
|
||||
}
|
||||
|
||||
TidyData();
|
||||
|
|
@ -275,7 +301,8 @@ public class AllPlayerSkillCultivateData
|
|||
AddLockConditionReaction(i);
|
||||
}
|
||||
}
|
||||
class conditionParamInt
|
||||
|
||||
private class ConditionParamInt
|
||||
{
|
||||
public int layerid;
|
||||
}
|
||||
|
|
@ -284,16 +311,24 @@ public class AllPlayerSkillCultivateData
|
|||
{
|
||||
|
||||
int[] UnLockCondition = TableManager.Instance.Tables.PlayerSkillLayer.Get(layerId).Unlock;
|
||||
conditionParamInt temp = new conditionParamInt();
|
||||
temp.layerid = layerId;
|
||||
ConditionReactor.Instance.AddReaction(UnLockCondition, OnUnlockConditionChanged,temp);
|
||||
ConditionParamInt temp = new()
|
||||
{
|
||||
layerid = layerId
|
||||
};
|
||||
ConditionReactor.Instance.AddReaction(UnLockCondition, OnUnlockConditionChanged, temp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解锁条件变化回调
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
/// <param name="callBackParam"></param>
|
||||
/// <param name="reactionID"></param>
|
||||
private void OnUnlockConditionChanged(bool result, object callBackParam, int reactionID)
|
||||
{
|
||||
if (result)
|
||||
{
|
||||
conditionParamInt temp = callBackParam as conditionParamInt;
|
||||
ConditionParamInt temp = callBackParam as ConditionParamInt;
|
||||
if(temp.layerid> PlayerSkillUnlockLevelData.GetSingleton().unlockLayer)
|
||||
{
|
||||
PlayerSkillUnlockLevelData.GetSingleton().unlockLayer = temp.layerid;
|
||||
|
|
@ -306,6 +341,7 @@ public class AllPlayerSkillCultivateData
|
|||
// PlayerSkillUnlockLevelData.GetSingleton().lockLayerDic[]
|
||||
}
|
||||
}
|
||||
|
||||
private void TidyData()
|
||||
{
|
||||
GetAllNextLockId();
|
||||
|
|
@ -318,12 +354,12 @@ public class AllPlayerSkillCultivateData
|
|||
{
|
||||
if (i != 1)
|
||||
{
|
||||
for (int j = 0; j < data.layerDataDic[i].dataList.Count; j++)
|
||||
for (int j = 0; j < data.dicLayerData[i].dataList.Count; j++)
|
||||
{
|
||||
var nowdata = data.layerDataDic[i].dataList[j];
|
||||
for (int k = 0; k < data.layerDataDic[i - 1].dataList.Count; k++)
|
||||
var nowdata = data.dicLayerData[i].dataList[j];
|
||||
for (int k = 0; k < data.dicLayerData[i - 1].dataList.Count; k++)
|
||||
{
|
||||
if (nowdata.unLockId.Contains(data.layerDataDic[i - 1].dataList[k].ID))
|
||||
if (nowdata.unLockId.Contains(data.dicLayerData[i - 1].dataList[k].ID))
|
||||
{
|
||||
nowdata.unLockIndex.Add(k);
|
||||
}
|
||||
|
|
@ -332,29 +368,25 @@ public class AllPlayerSkillCultivateData
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void TidyAllData()
|
||||
{
|
||||
TidySingleData(playerTypeDic[PlayerSkillType.Conduct]);
|
||||
TidySingleData(playerTypeDic[PlayerSkillType.Support]);
|
||||
TidySingleData(playerTypeDic[PlayerSkillType.Attack]);
|
||||
TidySingleData(dicPlayerSkillTypeData[PlayerSkillType.Conduct]);
|
||||
TidySingleData(dicPlayerSkillTypeData[PlayerSkillType.Support]);
|
||||
TidySingleData(dicPlayerSkillTypeData[PlayerSkillType.Attack]);
|
||||
}
|
||||
|
||||
private void TidySingleData(PlayerSkillTypeData data)
|
||||
{
|
||||
for (int i = 1; i < data.MaxLayer; i++)
|
||||
{
|
||||
if (data.layerDataDic[i].dataList.Count ==3)
|
||||
if (data.dicLayerData[i].dataList.Count == 3)
|
||||
{
|
||||
|
||||
for (int j = 0; j < data.layerDataDic[i].dataList.Count; j++)
|
||||
{
|
||||
|
||||
SinglePlayerSkillCultivateData singleData = data.layerDataDic[i].dataList[j];
|
||||
SinglePlayerSkillCultivateData maxChildData=null;
|
||||
for (int j = 0; j < data.dicLayerData[i].dataList.Count; j++)
|
||||
{
|
||||
SinglePlayerSkillCultivateData singleData = data.dicLayerData[i].dataList[j];
|
||||
SinglePlayerSkillCultivateData maxChildData = null;
|
||||
int maxChildCount = 0;
|
||||
if (singleData.nextLockId.Count > maxChildCount)
|
||||
{
|
||||
|
|
@ -362,44 +394,42 @@ public class AllPlayerSkillCultivateData
|
|||
maxChildData = singleData;
|
||||
}
|
||||
|
||||
List<SinglePlayerSkillCultivateData> tempList = new List<SinglePlayerSkillCultivateData>();
|
||||
tempList.AddRange(data.layerDataDic[i].dataList);
|
||||
List<SinglePlayerSkillCultivateData> tempList = new();
|
||||
tempList.AddRange(data.dicLayerData[i].dataList);
|
||||
tempList.Remove(maxChildData);
|
||||
data.layerDataDic[i].dataList.Clear();
|
||||
|
||||
data.layerDataDic[i].dataList.Add(tempList[0]);
|
||||
data.layerDataDic[i].dataList.Add(maxChildData);
|
||||
data.layerDataDic[i].dataList.Add(tempList[1]);
|
||||
data.dicLayerData[i].dataList.Clear();
|
||||
|
||||
data.dicLayerData[i].dataList.Add(tempList[0]);
|
||||
data.dicLayerData[i].dataList.Add(maxChildData);
|
||||
data.dicLayerData[i].dataList.Add(tempList[1]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GetUpIndexData(data);
|
||||
}
|
||||
|
||||
private void GetAllNextLockId()
|
||||
{
|
||||
GetSingleNextLockId(playerTypeDic[PlayerSkillType.Conduct]);
|
||||
GetSingleNextLockId(playerTypeDic[PlayerSkillType.Support]);
|
||||
GetSingleNextLockId(playerTypeDic[PlayerSkillType.Attack]);
|
||||
GetSingleNextLockId(dicPlayerSkillTypeData[PlayerSkillType.Conduct]);
|
||||
GetSingleNextLockId(dicPlayerSkillTypeData[PlayerSkillType.Support]);
|
||||
GetSingleNextLockId(dicPlayerSkillTypeData[PlayerSkillType.Attack]);
|
||||
|
||||
}
|
||||
|
||||
private void GetSingleNextLockId(PlayerSkillTypeData data)
|
||||
{
|
||||
for (int i = 1; i <= data.MaxLayer; i++)
|
||||
{
|
||||
for (int j = 0; j < data.layerDataDic[i].dataList.Count; j++)
|
||||
for (int j = 0; j < data.dicLayerData[i].dataList.Count; j++)
|
||||
{
|
||||
if (i != data.MaxLayer)
|
||||
{
|
||||
foreach (var val1 in allSinglePlayerDic.Keys)
|
||||
{
|
||||
if (allSinglePlayerDic[val1].unLockId.Contains( data.layerDataDic[i].dataList[j].ID))
|
||||
if (allSinglePlayerDic[val1].unLockId.Contains( data.dicLayerData[i].dataList[j].ID))
|
||||
{
|
||||
data.layerDataDic[i].dataList[j].AddNextLockID(val1);
|
||||
data.dicLayerData[i].dataList[j].AddNextLockID(val1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -408,7 +438,6 @@ public class AllPlayerSkillCultivateData
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public int GetMaxLayer()
|
||||
{
|
||||
int maxLayer = 0;
|
||||
|
|
@ -422,3 +451,224 @@ public class AllPlayerSkillCultivateData
|
|||
return maxLayer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 指挥官所有技能树数据
|
||||
/// </summary>
|
||||
public class AllCommandSkillTreeData
|
||||
{
|
||||
/// <summary>
|
||||
/// 指挥官技能树字典,key:技能类型 value:技能树数据
|
||||
/// </summary>
|
||||
private readonly Dictionary<PlayerSkillType, CommandSkillTreeData> dicSkillTree = new();
|
||||
|
||||
public AllCommandSkillTreeData()
|
||||
{
|
||||
foreach (DataPlayerSkillUpgrade skillUpgradeData in TableManager.Instance.Tables.PlayerSkillUpgrade.DataList)
|
||||
{
|
||||
if (!dicSkillTree.TryGetValue(skillUpgradeData.SkillType, out CommandSkillTreeData skillTreeData))
|
||||
{
|
||||
skillTreeData = new();
|
||||
dicSkillTree[skillUpgradeData.SkillType] = skillTreeData;
|
||||
}
|
||||
|
||||
skillTreeData.Add(skillUpgradeData);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据技能类型获取技能树数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public CommandSkillTreeData GetSkillTreeDataByType(PlayerSkillType type)
|
||||
{
|
||||
dicSkillTree.TryGetValue(type, out CommandSkillTreeData data);
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指挥官技能树数据
|
||||
/// </summary>
|
||||
public class CommandSkillTreeData
|
||||
{
|
||||
/// <summary>
|
||||
/// 每层指挥官技能
|
||||
/// </summary>
|
||||
private readonly List<HashSet<int>> listSetSkillId = new();
|
||||
|
||||
/// <summary>
|
||||
/// 获取技能树层数
|
||||
/// </summary>
|
||||
public int FloorCount
|
||||
{
|
||||
get { return listSetSkillId.Count; }
|
||||
}
|
||||
|
||||
public void Add(DataPlayerSkillUpgrade data)
|
||||
{
|
||||
int index = data.LayerID - 1;
|
||||
while (listSetSkillId.Count <= index)
|
||||
{
|
||||
listSetSkillId.Add(new());
|
||||
}
|
||||
|
||||
listSetSkillId[index].Add(data.ID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取该层的技能配置数据列表
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public List<CommandSkillData> GetSkillIDs(int index)
|
||||
{
|
||||
if (index > listSetSkillId.Count)
|
||||
{
|
||||
DebugUtil.LogError("数组越界");
|
||||
return null;
|
||||
}
|
||||
|
||||
HashSet<int> setId = listSetSkillId[index];
|
||||
List<CommandSkillData> listSkillData = new(setId.Count);
|
||||
foreach (int skillID in setId)
|
||||
{
|
||||
listSkillData.Add(new CommandSkillData(skillID));
|
||||
}
|
||||
|
||||
return listSkillData;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指挥官技能数据
|
||||
/// </summary>
|
||||
public class CommandSkillData
|
||||
{
|
||||
/// <summary>
|
||||
/// 技能id
|
||||
/// </summary>
|
||||
private int skillID;
|
||||
/// <summary>
|
||||
/// 技能等级
|
||||
/// </summary>
|
||||
private int skillLevel;
|
||||
/// <summary>
|
||||
/// 指挥官技能养成配置数据
|
||||
/// </summary>
|
||||
private DataPlayerSkillUpgrade skillUpgradeData;
|
||||
/// <summary>
|
||||
/// 指挥官技能配置数据
|
||||
/// </summary>
|
||||
private DataPlayerSkill playerSkill;
|
||||
|
||||
#region 属性
|
||||
/// <summary>
|
||||
/// 技能ID
|
||||
/// </summary>
|
||||
public int SkillID
|
||||
{
|
||||
get { return skillID; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解锁条件列表(配置的id升一级就解锁)
|
||||
/// </summary>
|
||||
public int[] ListUnLock
|
||||
{
|
||||
get { return skillUpgradeData.Unlock; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 技能名
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get { return CommonUtils.GetLocalizeText(playerSkill.NameLocal); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 技能描述
|
||||
/// </summary>
|
||||
public string Desc
|
||||
{
|
||||
get { return CommonUtils.GetLocalizeText(playerSkill.DescLocal); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图标路径
|
||||
/// </summary>
|
||||
public string IconPath
|
||||
{
|
||||
get { return $"{Constants.UI_PlaySkill_IconPathFolder}{playerSkill.IconPath}.png"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当前等级
|
||||
/// </summary>
|
||||
public int Level
|
||||
{
|
||||
get { return skillUpgradeData.Level; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 最大等级
|
||||
/// </summary>
|
||||
public int MaxLevel
|
||||
{
|
||||
get { return skillUpgradeData.MaxLevel; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 所在第几层
|
||||
/// </summary>
|
||||
public int Floor
|
||||
{
|
||||
get { return skillUpgradeData.LayerID; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否锁住
|
||||
/// </summary>
|
||||
public bool IsLock
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < skillUpgradeData.Unlock.Length; i++)
|
||||
{
|
||||
int level = Actor.Instance.PlayerSkill.GetLevel(skillUpgradeData.Unlock[i]);
|
||||
if (level < 1)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否满级
|
||||
/// </summary>
|
||||
public bool IsFullLevel
|
||||
{
|
||||
get { return Level >= MaxLevel; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
public CommandSkillData(int id)
|
||||
{
|
||||
skillID = id;
|
||||
skillLevel = Actor.Instance.PlayerSkill.GetLevel(id);
|
||||
skillUpgradeData = TableManager.Instance.Tables.PlayerSkillUpgrade.Get(skillID, skillLevel);
|
||||
playerSkill = TableManager.Instance.Tables.PlayerSkillConfig.Get(skillID);
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -10,10 +10,13 @@ using UnityEngine.UI;
|
|||
/// </summary>
|
||||
public abstract class UIBaseItem
|
||||
{
|
||||
public GameObject GoRoot;
|
||||
/// <summary>
|
||||
/// 根节点
|
||||
/// </summary>
|
||||
protected GameObject GoRoot;
|
||||
|
||||
/// <summary>
|
||||
/// 以缩放判定是否显示
|
||||
/// 以缩放判定是否显示(缩放比SetActive性能好,优先用这个)
|
||||
/// </summary>
|
||||
public bool IsScaleShow
|
||||
{
|
||||
|
|
@ -33,6 +36,20 @@ public abstract class UIBaseItem
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 以SetActivex显示隐藏
|
||||
/// </summary>
|
||||
public bool IsActive
|
||||
{
|
||||
get { return GoRoot.activeSelf; }
|
||||
set { GoRoot.SetActive(value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据现有实例构造
|
||||
/// </summary>
|
||||
/// <param name="root"></param>
|
||||
/// <param name="isScaleShow"></param>
|
||||
public UIBaseItem(GameObject root, bool isScaleShow = false)
|
||||
{
|
||||
GoRoot = root;
|
||||
|
|
@ -40,6 +57,20 @@ public abstract class UIBaseItem
|
|||
IsScaleShow = isScaleShow;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据现有实例克隆新的实例并构造
|
||||
/// </summary>
|
||||
/// <param name="root"></param>
|
||||
/// <param name="i"></param>
|
||||
/// <param name="isScaleShow"></param>
|
||||
public UIBaseItem(GameObject root, int i, bool isScaleShow = false)
|
||||
{
|
||||
GoRoot = UnityEngine.Object.Instantiate(root, root.transform.parent);
|
||||
GoRoot.name = i.ToString();
|
||||
|
||||
IsScaleShow = isScaleShow;
|
||||
}
|
||||
|
||||
#region 绑定方法
|
||||
public GameObject BindButton(string target, Action action, bool playAudio = true)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,36 +12,20 @@ using ScrollView = PhxhSDK.PhxhScrollView;
|
|||
|
||||
public class CommandSkill_CultivateBinder
|
||||
{
|
||||
|
||||
public static void GetComponents(UI_CommandSkillCultivateController window)
|
||||
{
|
||||
window.Button_Back = window.GetComponent<Button>("ImageBG/UI_Topbtn/Button_Back");
|
||||
window.Text_Back = window.GetComponent<TMP_Text>("ImageBG/UI_Topbtn/Button_Back/Text_Back");
|
||||
window.Button_Home = window.GetComponent<Button>("ImageBG/UI_Topbtn/Button_Home");
|
||||
window.Text_PointTotal = window.GetComponent<TMP_Text>("ImageBG/UI_Topbtn/LevelPoint/Icon_BG/Text_PointTotal");
|
||||
window.Image_CommandBG = window.GetComponent<Image>("ImageBG/Image_CommandBG");
|
||||
window.Image_Seperate01 = window.GetComponent<Image>("ImageBG/Image_CommandBG/ScrollRect/Image_Seperate01");
|
||||
window.Image_Seperate02 = window.GetComponent<Image>("ImageBG/Image_CommandBG/ScrollRect/Image_Seperate02");
|
||||
window.Image_DownBG = window.GetComponent<Image>("ImageBG/Image_DownBG");
|
||||
window.Image_LeftBtnBG = window.GetComponent<Image>("ImageBG/Image_DownBG/Image_LeftBtnBG");
|
||||
window.Button_Minus = window.GetComponent<Button>("ImageBG/Image_DownBG/Image_LVUpBG/Button_Minus");
|
||||
window.Button_Plus = window.GetComponent<Button>("ImageBG/Image_DownBG/Image_LVUpBG/Button_Plus");
|
||||
window.Button_LevelUp = window.GetComponent<Button>("ImageBG/Image_DownBG/Button_LevelUp");
|
||||
window.Go_PhysicalBG = window.FindObj("ImageBG/Image_DownBG/Button_LevelUp/Image_physicalBG");
|
||||
window.Image_ChooseIcon = window.GetComponent<Image>("ImageBG/Image_DownBG/Image_LeftBtnBG/Image_ChooseIcon");
|
||||
window.Image_DetailBG = window.GetComponent<Image>("ImageBG/Image_DownBG/Image_DetailBG");
|
||||
window.Text_IconName = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Image_DetailBG/Text_IconName");
|
||||
window.Text_IconLV = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Image_DetailBG/Text_IconLV");
|
||||
window.Text_Level = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Image_DetailBG/Text_IconLV");
|
||||
window.Text_IconDescribe = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Image_DetailBG/Text_IconDescribe");
|
||||
window.Image_LVUpBG = window.GetComponent<Image>("ImageBG/Image_DownBG/Image_LVUpBG");
|
||||
window.Text_Num = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Image_LVUpBG/Text_Num");
|
||||
window.Button_Minus = window.GetComponent<Button>("ImageBG/Image_DownBG/Image_LVUpBG/Button_Minus");
|
||||
window.Button_Plus = window.GetComponent<Button>("ImageBG/Image_DownBG/Image_LVUpBG/Button_Plus");
|
||||
window.Button_Confirm = window.GetComponent<Button>("ImageBG/Image_DownBG/Button_Confirm");
|
||||
window.Image_physicalBG = window.GetComponent<Image>("ImageBG/Image_DownBG/Button_Confirm/Image_physicalBG");
|
||||
window.Image_Physical = window.GetComponent<Image>("ImageBG/Image_DownBG/Button_Confirm/Image_physicalBG/Image_Physical");
|
||||
window.Text_PhysicalNum = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Button_Confirm/Image_physicalBG/Text_PhysicalNum");
|
||||
window.Text_StartSweep = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Button_Confirm/Text_StartSweep");
|
||||
window.Image_physicalBGGrey= window.GetComponent<Image>("ImageBG/Image_DownBG/Button_Confirm_Grey/Image_physicalBG");
|
||||
window.Image_Physical = window.GetComponent<Image>("ImageBG/Image_DownBG/Button_Confirm_Grey/Image_physicalBG/Image_Physical");
|
||||
window.Text_PhysicalNumGrey = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Button_Confirm_Grey/Image_physicalBG/Text_PhysicalNum");
|
||||
window.Text_StartSweep = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Button_Confirm_Grey/Text_StartSweep");
|
||||
window.Text_PhysicalNum = window.GetComponent<TMP_Text>("ImageBG/Image_DownBG/Button_LevelUp/Image_physicalBG/Text_PhysicalNum");
|
||||
}
|
||||
|
||||
/****** 定义变量语句 ******
|
||||
|
|
|
|||
|
|
@ -225,12 +225,14 @@ namespace Gameplay
|
|||
//}
|
||||
//???????
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取本地化文本
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetLocalizeText(string key)
|
||||
{
|
||||
string str = StringManager.Instance.GetLocalizeTextByKey(key);
|
||||
|
||||
return str;
|
||||
return StringManager.Instance.GetLocalizeTextByKey(key);
|
||||
}
|
||||
|
||||
public static string GetLocalizeText(string key, params object[] param)
|
||||
|
|
|
|||
|
|
@ -602,7 +602,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -622,7 +624,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -642,7 +646,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -662,7 +668,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -682,7 +690,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -702,7 +712,9 @@
|
|||
"skillType": 1,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
311
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -830,7 +842,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -848,7 +862,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -866,7 +882,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -884,7 +902,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -902,7 +922,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
@ -920,7 +942,9 @@
|
|||
"skillType": 2,
|
||||
"LayerID": 2,
|
||||
"SkillID": 0,
|
||||
"Unlock": [],
|
||||
"Unlock": [
|
||||
3002
|
||||
],
|
||||
"Cost": [
|
||||
{
|
||||
"Id": 1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue