24 lines
869 B
C#
24 lines
869 B
C#
using UnityEngine;
|
|
|
|
public class DebugBroker : MonoBehaviour
|
|
{
|
|
EntityEventBroker broker;
|
|
|
|
private void Awake()
|
|
{
|
|
broker = GetComponentInParent<EntityEventBroker>();
|
|
|
|
broker.OnIncomingDamage.Subscribe((x) => DebugDamageArgs("dealing damage to", x));
|
|
broker.OnIncomingDamageProcessed.Subscribe((x) => DebugDamageArgs("dealing damage to", x));
|
|
|
|
broker.OnOutgoingDamage.Subscribe((x) => DebugDamageArgs("dealing damage to", x));
|
|
broker.OnOutgoingDamageProcessed.Subscribe((x) => DebugDamageArgs("dealing damage to", x));
|
|
}
|
|
|
|
|
|
private void DebugDamageArgs(string prefix, DamageArgs args)
|
|
{
|
|
Debug.Log($"Broker Debugger: {args.user}'s {args.effect.name} {prefix}: {args.target} => {args.currentValue}, isCrit? {args.isCrit}, dmgType={args.damageType}, targets hit total ={args.totalTargetsHit}");
|
|
}
|
|
}
|