NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Buff/BaseSkillBuff.cs

42 lines
1.1 KiB
C#
Raw Normal View History

2023-10-19 15:00:19 +08:00
using Gameplay.Common;
using Gameplay.Summon;
2023-08-22 19:08:45 +08:00
namespace Gameplay.Buff
{
using cfg.BuffCfg;
using Gameplay.Skill;
2023-10-19 15:00:19 +08:00
public class BaseSkillBuff : BaseBuff
2023-08-22 19:08:45 +08:00
{
protected SkillHandle _skill;
2023-10-19 15:00:19 +08:00
public override void Ctor(GameUnit creator,
DataBuff configData)
2023-08-22 19:08:45 +08:00
{
2023-10-19 15:00:19 +08:00
if (creator == null)
{
DebugUtil.LogError("创建者为空");
return;
}
switch (creator.gameunitType)
{
case EGameUnitType.Character:
case EGameUnitType.Vehicle:
var skillManager = SkillManager.instance.GetUnitSkillManager(creator);
_skill = skillManager.positiveSkill;
break;
case EGameUnitType.Summon:
_skill = (creator as BaseSummon)?.createSkill;
break;
default:
DebugUtil.LogError("不支持的类型:{0}", creator.gameunitType);
break;
}
base.Ctor(creator, configData);
2023-08-22 19:08:45 +08:00
}
}
}