Example #1
0
    private GasContainer GetInternalGasMix()
    {
        if (playerScript != null)
        {
            Dictionary <string, InventorySlot> inventory = playerScript.playerNetworkActions.Inventory;

            // Check if internals exist
            ItemAttributes mask        = inventory.ContainsKey("mask") ? inventory["mask"]?.ItemAttributes : null;
            ItemAttributes suitStorage = inventory.ContainsKey("suitStorage") ? inventory["suitStorage"]?.ItemAttributes : null;

            bool internalsEnabled = equipment.IsInternalsEnabled;

            if (mask != null && suitStorage != null && mask.ConnectedToTank && internalsEnabled)
            {
                return(suitStorage.GetComponent <GasContainer>());
            }
        }

        return(null);
    }