working on humbie still
This commit is contained in:
30
Assets/jelycho/Code/Enemies/Zombie/ZombieHurtbox.cs
Normal file
30
Assets/jelycho/Code/Enemies/Zombie/ZombieHurtbox.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using RebootKit.Engine.Main;
|
||||
using RebootKit.Engine.Simulation;
|
||||
using RebootReality.jelycho.Damage;
|
||||
using RebootReality.jelycho.Main;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
|
||||
namespace RebootReality.jelycho.Enemies.Zombie {
|
||||
public class ZombieHurtbox : MonoBehaviour, IHurtbox {
|
||||
public ZombieActor owner;
|
||||
[SerializeField] ZombieBodyPartType m_BodyPart = ZombieBodyPartType.Body;
|
||||
|
||||
void Awake() {
|
||||
Assert.IsNotNull(owner);
|
||||
}
|
||||
|
||||
public void ReceiveDamage(Actor attacker, ulong damage, float3 worldHitPos) {
|
||||
if (!owner.HasBodyPart(m_BodyPart)) {
|
||||
return;
|
||||
}
|
||||
|
||||
owner.ReceiveBodyPartDamage(damage, m_BodyPart);
|
||||
|
||||
if (RR.World.Context is WorldContext worldContext) {
|
||||
worldContext.FeedbacksManager.SpawnBloodSplash(worldHitPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user