
It’s been a little while since I’ve done any coding so I might be a bit rusty, but from what I can tell, PauseMenu.gameObject.SetActive(true) is basically just telling the program to set the PauseMenu’s attribute, known as gameObject to be true. When the gameObject is set to true, the game knows to activate the pause menu. The gameObject might be the menu’s appearance if it’s associated with any resources, otherwise it may just be an indicator of PauseMenu’s status, of being activated or not.
If you’re certain that gameObject needs to be replaced, then I’d look under PauseMenu, checking if it has any associated attributes or variables that are binary/boolean/whatever your language calls variables that can only be set to true or false, and that’s probably what you’re looking for. Otherwise, unless you replace it with something that’s been already established earlier in the code, it won’t work
I honestly have no idea. That all depends on a lot of things that I just don’t know about, which may be specific to your situation/program. But if you think that’s the right approach, try it and see what happens. If it works, great. If not, then you may need to try a different approach. Sorry I can’t be more help, I just can’t really say for sure if it’s right or wrong