示例#1
0
 public static bool CanUseRadio(Character sender, out WifiComponent radio)
 {
     radio = null;
     if (sender?.Inventory == null || sender.Removed)
     {
         return(false);
     }
     radio = sender.Inventory.Items.FirstOrDefault(i => i?.GetComponent <WifiComponent>() != null)?.GetComponent <WifiComponent>();
     if (radio?.Item == null)
     {
         return(false);
     }
     return(sender.HasEquippedItem(radio.Item) && radio.CanTransmit());
 }