Example #1
0
    public static bool IsRefrigerated(GameObject gameObject)
    {
        int num = Grid.PosToCell(gameObject);

        if (Grid.IsValidCell(num))
        {
            if (Grid.Temperature[num] < 277.15f)
            {
                return(true);
            }
            Pickupable component = gameObject.GetComponent <Pickupable>();
            if ((Object)component != (Object)null && (Object)component.storage != (Object)null)
            {
                Refrigerator component2 = component.storage.GetComponent <Refrigerator>();
                return((Object)component2 != (Object)null && component2.IsActive());
            }
        }
        return(false);
    }