示例#1
0
    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);
        }
    }
示例#2
0
 void OnAttacked(AttackMessageArgs msg)
 {
     if (!isAttached)
     {
         msg.recieved = true;
         PlayerHealth playerHealth = msg.sender.GetComponentInParent <PlayerHealth>();
         if (playerHealth)
         {
             playerHealth.AttachEye(transform, isRight);
         }
     }
 }