34 lines
889 B
C#
34 lines
889 B
C#
|
using Cal.DataTable;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
public class AddPetIntimacyGoodsEffect: GoodsEffect
|
|||
|
{
|
|||
|
public override string Init(Unit unit, GoodsBase goodsBase, bool isLock = false)
|
|||
|
{
|
|||
|
base.unit = unit;
|
|||
|
GoodsBase = goodsBase;
|
|||
|
return Run();
|
|||
|
}
|
|||
|
|
|||
|
private string Run()
|
|||
|
{
|
|||
|
PlayerData data = this.unit.GetComponent<PlayerData>();
|
|||
|
if (data.petEatCount <= 0)
|
|||
|
{
|
|||
|
return "喂养次数达到上限";
|
|||
|
}
|
|||
|
|
|||
|
data.petEatCount--;
|
|||
|
UnitHelper.SaveComponenet(data).Coroutine();
|
|||
|
Pet pet = this.unit.GetComponent<Pet>();
|
|||
|
pet.AddIntimacy(this.GoodsBase.CommonIncrease);
|
|||
|
return string.Empty;
|
|||
|
}
|
|||
|
|
|||
|
public override async ETVoid Execute()
|
|||
|
{
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|