1
This commit is contained in:
@@ -30,6 +30,7 @@ namespace BITFALL.Melee
|
||||
private static readonly Queue<MeleeCommand> Queue = new();
|
||||
public static void Melee(MeleeCommand command)=>Queue.Enqueue(command);
|
||||
[SerializeField] private LayerMask detectLayer;
|
||||
[SerializeReference, SubclassSelector] private IDamageService damageService;
|
||||
private void Awake()
|
||||
{
|
||||
Singleton = this;
|
||||
@@ -52,17 +53,24 @@ namespace BITFALL.Melee
|
||||
}
|
||||
|
||||
damaged.Add(damageable.Entity);
|
||||
damageable.GiveDamage(new DamageMessage()
|
||||
var damageMsg =
|
||||
new DamageMessage()
|
||||
{
|
||||
initiator = UnityEntitiesService.Get(command.PlayerId) as IEntity,
|
||||
damageType = new MeleeDamageMessage
|
||||
Initiator = UnityEntitiesService.Get(command.PlayerId) as IEntity,
|
||||
DamageType = new MeleeDamageMessage
|
||||
{
|
||||
|
||||
},
|
||||
target = damageable.Entity,
|
||||
damage = command.Damage is 0 ? 64 : command.Damage,
|
||||
hit = damageable,
|
||||
});
|
||||
Target = damageable.Entity,
|
||||
Damage = command.Damage is 0 ? 64 : command.Damage,
|
||||
Hit = damageable,
|
||||
};
|
||||
if (command.PlayerId !=default)
|
||||
{
|
||||
damageMsg.Initiator = UnityEntitiesService.Get(command.PlayerId) as IEntity;
|
||||
}
|
||||
damageService.Execute(damageMsg);
|
||||
|
||||
damageable.Rigidbody.AddForceAtPositionAsync(command.Force, command.Position, ForceMode.Impulse)
|
||||
.Forget();
|
||||
|
||||
|
Reference in New Issue
Block a user