Exemplo n.º 1
0
 //[Command]
 public void ShootPC(GameObject hitPoint, int dmg, int layer)
 {
     if (hitPoint)
     {
         ControlPC _pc = hitPoint.GetComponent <HitboxLink>().pc;
         if (_pc)
         {
             print("PC hit");
             if (layer == 10)    // if it's a headshot
             {
                 _pc.TakeDamage(weaponDamage * 2);
             }
             else    // it's a body shot
             {
                 _pc.TakeDamage(weaponDamage);
             }
         }
         else
         {
             print("No PC");
         }
     }
 }