private bool toggle = false; // global variable default is off
public void changeMonsterOn ()
{
toggle = !toggle; // if toggle is false then it would be true, if toggle is true then it would be false like on and off
monster.SetActive(toggle); // pass the toggle value
}