52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
using Cal.DataTable;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
public class AddIdleExpSpeedGoodsEffect : GoodsEffect
|
|
{
|
|
|
|
public override string Init(Unit unit, GoodsBase goodsBase,bool isLock =false)
|
|
{
|
|
//base.unit = unit;
|
|
//base.unitId = unit.Id;
|
|
//GoodsBase = goodsBase;
|
|
//BuffEndTime = TimeHelper.ClientNow() + GoodsBase.ContinuedSeconds;
|
|
//GoodsEffectComponent.Instance.AddGoodsBuff(unit.Id,GoodsEffectType.AddIdleExpSpeed,this);
|
|
//unit.GetComponent<PlayerData>().IdleExpSpeed = GoodsBase.ExpRange;
|
|
//BuffState = BuffState.Running;
|
|
BuffState = BuffState.Finished;
|
|
return string.Empty;
|
|
}
|
|
|
|
public override void ReInit(Unit unit, GoodsBase goodsBase,long endTime)
|
|
{
|
|
//base.unit = unit;
|
|
//base.unitId = unit.Id;
|
|
//GoodsBase = goodsBase;
|
|
//BuffEndTime = endTime;
|
|
//GoodsEffectComponent.Instance.AddGoodsBuff(unit.Id, GoodsEffectType.AddIdleExpSpeed, this);
|
|
//BuffState = BuffState.Running;
|
|
BuffState = BuffState.Finished;
|
|
}
|
|
public override async ETVoid Execute()
|
|
{
|
|
//if (BuffEndTime > TimeHelper.ClientNow()) return;
|
|
//if (!unit)
|
|
//{
|
|
// using Unit _unitInLib = await UnitHelper.Query(Game.Scene, unitId);
|
|
// if (_unitInLib != null)
|
|
// {
|
|
// _unitInLib.GetComponent<PlayerData>().IdleExpSpeed = 1;
|
|
// BuffState = BuffState.Finished;
|
|
// return;
|
|
// }
|
|
// Log.Error($"玩家Id=【{unitId}】 在数据库中不存在");
|
|
//}
|
|
//unit.GetComponent<PlayerData>().IdleExpSpeed = 1;
|
|
//BuffState = BuffState.Finished;
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |