1
This commit is contained in:
@@ -5,7 +5,6 @@ using System.Text;
|
||||
using BITFALL.Bullet;
|
||||
using UnityEngine;
|
||||
using BITKit;
|
||||
using BITKit.Core.Entites;
|
||||
using BITKit.Entities;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
@@ -121,15 +120,23 @@ namespace BITFALL
|
||||
var force = (raycastHit.point - (Vector3)bullet.pos).normalized * (physicsInfo?.AddForceMultiple ?? 64);
|
||||
if (raycastHit.collider.TryGetComponent<IDamagable>(out var damagable))
|
||||
{
|
||||
if (damagable.Entity.Id == bullet.initiator) return false;
|
||||
if (damagable.UnityEntity?.Id == bullet.initiator) return false;
|
||||
if (layerMask.Includes(raycastHit.collider.gameObject.layer) is false) return false;
|
||||
var msg = new DamageMessage()
|
||||
{
|
||||
Target = damagable.Entity,
|
||||
Target = damagable.UnityEntity,
|
||||
Hit = damagable,
|
||||
Damage = bullet.initialDamage,
|
||||
};
|
||||
damageService.Execute(msg);
|
||||
if (damagable is IEntityComponent)
|
||||
{
|
||||
damageService.Execute(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
damagable.GiveDamage(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var _rigidbody = (raycastHit.rigidbody,damagable?.Rigidbody) switch
|
||||
|
Reference in New Issue
Block a user