zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Common/Bag/LearnSkillGoodsEffect.cs

34 lines
977 B
C#

using Cal.DataTable;
using System;
using System.Collections.Generic;
using System.Text;
namespace ET
{
public class LearnSkillGoodsEffect : GoodsEffect
{
public override string Init(Unit unit, GoodsBase goodsBase,bool isLock =false)
{
base.unit = unit;
GoodsBase = goodsBase;
return Run();
}
private string Run()
{
UnitSkillComponent unitSkillComponent = unit.GetComponent<UnitSkillComponent>();
string ret = unitSkillComponent.LearnSkill(GoodsBase.CommonIncrease / 100, GoodsBase.CommonIncrease % 100);
if (!ret.Equals(string.Empty))
{
return ret;
}
Game.EventSystem.Publish(new EventType.ChangeBattleCharacter { unit = unit }).Coroutine();
return string.Empty;
}
public override async ETVoid Execute()
{
await ETTask.CompletedTask;
}
}
}