public void OnAttacked(AttackMessageArgs msg) { Debug.Log(gameObject.name + ": Got attacked"); msg.recieved = true; Attack attack = msg.sender.GetComponent <Attack>(); if (attack) { attack.DealDamageTo(this, msg.type); } }
void OnAttacked(AttackMessageArgs msg) { if (!isAttached) { msg.recieved = true; PlayerHealth playerHealth = msg.sender.GetComponentInParent <PlayerHealth>(); if (playerHealth) { playerHealth.AttachEye(transform, isRight); } } }