1
This commit is contained in:
14
Unity/Scripts/Entity/Components/Impact/EntityImpact.cs
Normal file
14
Unity/Scripts/Entity/Components/Impact/EntityImpact.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace BITKit.Entities
|
||||
{
|
||||
public class EntityImpact : EntityComponent, IPhysicsImpact
|
||||
{
|
||||
public void AddImpact(Vector3 force)
|
||||
{
|
||||
var damage = (int)(-force.sqrMagnitude);
|
||||
entity.Invoke<int>("AddHP", damage);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user