playMaker

Author Topic: "Set gui depth" prevents GUI to disable  (Read 908 times)

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • Grinder Games
"Set gui depth" prevents GUI to disable
« on: May 07, 2013, 07:27:39 AM »
Playmaker 1.5.7

If you use a "Set gui depth" action somewhere in a FSM its impossible to disable any GUI button inside the same FSM by the "enable GUI" action (also disabling/deleting the Playmaker GUI component has no effect).

Also when using "set gui depth" action: preview while editing doesnt work anymore for this fsm.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3206
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: "Set gui depth" prevents GUI to disable
« Reply #1 on: May 07, 2013, 12:22:16 PM »
Thanks for these reports.

For performance reasons, PlayMaker batches all OnGUI calls in a single OnGUI call from PlayMakerGUI. However, this doesn't work well with GUI.depth, so whenever you use Set GUI Depth all GUI calls from that FSM are pulled out of the batch and run in their own OnGUI, not by PlayMakerGUI.

This solution was a quick fix so users could still use GUI.depth, but it has some unforeseen consequences. E.g., Enable GUI turns PlayMakerGUI off/on which doesn't effect GUI not drawn by the PlayMakerGUI component!

I'll take a look to see if there are fixes for these problems. But you might want to also explore workarounds to avoid Set GUI Depth (for better performance too!).

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • Grinder Games
Re: "Set gui depth" prevents GUI to disable
« Reply #2 on: May 07, 2013, 11:49:45 PM »
Hi Alex,
thanks for pointing that out. Maybe a short notice in the "set gui depth" action would help.

I have deleted all "set gui depth" actions from my project and reduced the use of on.gui actions to a minimum. I used it when i didnt knew enough about the pros and cons of the different GUI systems.

I think the GUI concepts of Unity are one of the most confusing parts for a Unity/Playmaker beginner.