Hi,
So, I have this simple code:
public class SettingsMenu : MonoBehaviour
{
public GameObject modalWindow;
void Start()
{
modalWindow.SetActive(false);
}
public void OpenModal()
{
modalWindow.SetActive(true);
}
I want it to show modal window with my custom options, when you click this button called "OPCJE" (which means "OPTIONS" in Polish):
So, basically, the problem is when I have opposite false/true statement. I mean, if I have modal opened and I want it to close - everything works perfect. It doesn't work when I try to OPEN modal window.
In Makinom I have something like this:
Is there a possible way to do this sort of thing easier, or try to force my way to work :)?
Change the game object setup in a way that the searched game object stays active in any case, e.g. just disabling a child object on it instead.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
E.g. using an animation machine (which has different functions to call for passing on parameters or no parameters):
- class name: AnimationMachineComponent
- function name: AnimationEvent (for no parameter), AnimationEventFloat (for float parameter), etc.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!