54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using cfg.SummonCfg;
|
|
using Gameplay.Summon.Logic;
|
|
using Gameplay.Unit;
|
|
namespace Gameplay.Summon
|
|
{
|
|
public class LogicCombineSummon : BaseSummon
|
|
{
|
|
|
|
protected List<BaseSummonLogic> _logics;
|
|
|
|
public LogicCombineSummon(DataSummon configData,
|
|
uint id,
|
|
GameUnit creator) : base(configData, id, creator)
|
|
{
|
|
_logics = new List<BaseSummonLogic>();
|
|
}
|
|
|
|
protected void _AddLogic(BaseSummonLogic logic)
|
|
{
|
|
logic.Init();
|
|
_logics.Add(logic);
|
|
}
|
|
|
|
protected override void _OnInitFsm()
|
|
{
|
|
base._OnInitFsm();
|
|
_fsm.Add(new SummonStateNothingIdle(this));
|
|
|
|
_fsm.ChangeState(ESummonState.Idle);
|
|
}
|
|
|
|
protected override void _OnLogicUpdate(float dt)
|
|
{
|
|
base._OnLogicUpdate(dt);
|
|
for (int i = 0; i < _logics.Count; i++)
|
|
{
|
|
_logics[i].LogicUpdate(dt);
|
|
}
|
|
}
|
|
|
|
protected override void OnDispose()
|
|
{
|
|
base.OnDispose();
|
|
|
|
for (int i = 0; i < _logics.Count; i++)
|
|
{
|
|
_logics[i].Dispose();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|