using System.Collections; using System.Collections.Generic; using System.Data.OleDb; using BITFALL.Bullet; using BITFALL.Guns; using BITFALL.Items.Melee; using BITKit; using BITKit.Entities.Melee; using UnityEngine; namespace BITFALL.Entities.Equipment { public class AIMeleeController : AIEquipController { [SerializeField] private bool forceAttack; private readonly IntervalUpdate interval = new(1); private AssetableMelee assetableMelee=>assetableItem as AssetableMelee; public override void Entry() { base.Entry(); UnityEntity.AddListener(OnAttack); } public override void Exit() { base.Exit(); UnityEntity.RemoveListener(OnAttack); } public override void OnUpdate(float deltaTime) { if (forceAttack && interval.AllowUpdate) { OnAttack(new BITConstant.Command.AttackCommand()); } } private void OnAttack(BITConstant.Command.AttackCommand obj) { UnityEntity.Invoke(Constant.Animation.Play, BITConstant.Player.Melee); } } }