

Initially developed as a part of CybergrindDeathcam, this library allows to track which enemy has dealt the damage once the player is hurt.
Currently, only enemies present in Cybergrind mode are supported (soon to be updated).
Simply subscribe to OnPlayerHurt event of EnemyIdentifierManager instance in order to receive an info regarding who hurt the player, how many damage it inflicted and whether it's killed the player or not.
Like this:
EnemyIdentifierManager.Instance.OnPlayerHurt += hurtEvent =>
{
if (hurtEvent.EnemyId != null)
Debug.Log($"Player got hurt by {hurtEvent.EnemyId.GetEnemyName()}");
Debug.Log($"Inflicted damage: {hurtEvent.Damage}");
if (hurtEvent.PlayerIsKilled)
Debug.Log("Player is killed");
};
Example output of a snippet above with player getting lynched by Stray, Swordsmachine and a Virtue
You can also retrieve all sorts of information regarding an enemy using EnemyId field (vanilla EnemyIdentifier type encapsulates lots of info, including enemy type, its GameObject, health etc)
Notice how EnemyId is a nullable value. When it's null, there are 3 possible options here: