49 lines
1.0 KiB
C#
49 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Gameplay.Common;
|
|
|
|
namespace Gameplay.Skill
|
|
{
|
|
using cfg.SkillCfg;
|
|
using Character;
|
|
|
|
public class SkillHandle
|
|
{
|
|
|
|
public readonly GameUnit owner;
|
|
|
|
public readonly SkillRuntimeData runtimeData;
|
|
|
|
public bool canRelease
|
|
{
|
|
get
|
|
{
|
|
return runtimeData.remainCDTime <= 0;
|
|
}
|
|
}
|
|
|
|
public SkillHandle(GameUnit owner, DataSkill configData)
|
|
{
|
|
this.owner = owner;
|
|
runtimeData = new SkillRuntimeData(configData);
|
|
|
|
// 一开始处于可释放状态
|
|
runtimeData.remainCDTime = 0;
|
|
}
|
|
|
|
public void LogicUpdate(float dt)
|
|
{
|
|
runtimeData.remainCDTime -= dt;
|
|
}
|
|
|
|
public void Use(int targetCellIndex)
|
|
{
|
|
runtimeData.remainCDTime = runtimeData.configData.CDTime;
|
|
owner.UseSkill(targetCellIndex, this);
|
|
}
|
|
}
|
|
}
|