This commit is contained in:
CortexCore
2023-10-30 01:25:53 +08:00
parent add6d0cab3
commit 18f664a545
125 changed files with 3529 additions and 700 deletions

View File

@@ -1,7 +1,9 @@
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;
@@ -14,6 +16,7 @@ namespace BITFALL.Entities.Equipment
[SerializeField] private bool forceAttack;
private readonly IntervalUpdate interval = new(1);
private AssetableMelee assetableMelee=>assetableItem as AssetableMelee;
public override void Entry()
{
base.Entry();
@@ -37,6 +40,25 @@ namespace BITFALL.Entities.Equipment
{
UnityEntity.Invoke(Constant.Animation.Play, BITConstant.Player.Melee);
}
protected override void OnAnimationEvent(string animationEventName)
{
switch (animationEventName)
{
case BITConstant.Player.Attack:
case BITConstant.Player.Melee:
meleeService.Melee(new MeleeCommand()
{
Damage = assetableMelee.MeleeDamage,
Force = assetableMelee.MeleeForce,
PlayerId = Entity.Id,
Position = transform.position,
Range = assetableMelee.MeleeRange,
Forward = UnityEntity.transform.forward,
});
break;
}
}
}
}