38 lines
874 B
C#
38 lines
874 B
C#
using Gameplay.Bullet;
|
|
namespace Gameplay.Summon.Logic
|
|
{
|
|
public class SLogicDelayEmitBulletToSelf : BaseSummonLogic
|
|
{
|
|
|
|
public int bulletId;
|
|
public float delayTime;
|
|
|
|
private float _delayTimer;
|
|
|
|
public SLogicDelayEmitBulletToSelf(BaseSummon summon) : base(summon)
|
|
{
|
|
}
|
|
|
|
protected override void _OnInit()
|
|
{
|
|
base._OnInit();
|
|
|
|
_delayTimer = delayTime;
|
|
}
|
|
|
|
protected override void _OnLogicUpdate(float dt)
|
|
{
|
|
base._OnLogicUpdate(dt);
|
|
|
|
_delayTimer -= dt;
|
|
|
|
if (_delayTimer < 0)
|
|
{
|
|
_delayTimer = delayTime;
|
|
BulletManager.instance.EmitBulletFromSummon(bulletId, _summon.transData.cellIndex, _summon);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|