Issue with IF Statements

I’m currently trying to check if an object is activated and, depending on whether it is active or not, set it to the opposite. So if it is active, deactivate it. Here is what I have so far:

public void BloomToggled()
    {
        //Bloom =

        if (Bloom.SetActive(true)
        {
            Bloom.SetActive(false);
        }
        else if (Bloom.SetActive(false))
        {
            Bloom.SetActive(true);
        }
       
    }

The only issue is that Bloom.SetActive(false), for example, isn’t the correct way to check if it is active or not in an IF statement. Anybody know what I should replace this with?

Off the top of my head it would be better to use

public void BloomToggled()
    {
        //Bloom =
        if (Bloom.enabled
        {
            Bloom.SetActive(false);
        }
        else
        {
            Bloom.SetActive(true);
        }
      
    }
public void BloomToggled()
{
    Bloom.SetActive(!Bloom.activeSelf);
}
2 Likes