//--------------------------------------------------------
|
// [Author]: YYL
|
// [ Date ]: 2025年7月11日
|
//--------------------------------------------------------
|
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Threading;
|
using System;
|
using UnityEngine;
|
using LitJson;
|
|
public partial class SkillConfig : ConfigBase<int, SkillConfig>
|
{
|
public SkillType skillType;
|
public SkillCastMode castMode;
|
|
public SkillEffectType effectType;
|
|
//技能类型:技能等级:技能
|
static Dictionary<int, Dictionary<int, SkillConfig>> skillDics = new Dictionary<int, Dictionary<int, SkillConfig>>();
|
protected override void OnConfigParseCompleted()
|
{
|
base.OnConfigParseCompleted();
|
|
skillType = (SkillType)SkillType;
|
castMode = (SkillCastMode)CastPosition;
|
effectType = (SkillEffectType)EffectType;
|
// #if UNITY_EDITOR
|
// if (Launch.Instance.isOpenBattleDebug)
|
// {
|
// if (castMode == SkillCastMode.None)
|
// {
|
// castMode = SkillCastMode.Target;
|
// }
|
// }
|
// #endif
|
|
Dictionary<int, SkillConfig> tempDic = null;
|
if (!skillDics.TryGetValue((int)skillType, out tempDic))
|
{
|
tempDic = new Dictionary<int, SkillConfig>();
|
skillDics.Add((int)skillType, tempDic);
|
}
|
tempDic[SkillLV] = this;
|
}
|
|
public MotionName GetMotionName()
|
{
|
return Enum.Parse<MotionName>(SkillMotionName);
|
}
|
|
public static SkillConfig GetSkillConfig(int skillType, int skillLv)
|
{
|
Dictionary<int, SkillConfig> tempDic = null;
|
if (!skillDics.TryGetValue(skillType, out tempDic))
|
{
|
return null;
|
}
|
SkillConfig config = null;
|
tempDic.TryGetValue(skillLv, out config);
|
return config;
|
}
|
}
|