playMaker

Author Topic: GUI Depth, does it work?  (Read 2821 times)

Kaneydien

  • Playmaker Newbie
  • *
  • Posts: 15
GUI Depth, does it work?
« on: October 01, 2013, 09:42:05 PM »
Hi everyone. I saw some old posts from years back about this. I was just messing around playmaker and trying to set up some buttons and set the gui depth with that action, but it does not seem to be working. Also, once you put in a gui depth action, the preview stops working(very annoying!). Does anyone know if there is a way to get this working?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: GUI Depth, does it work?
« Reply #1 on: October 02, 2013, 09:06:48 AM »
GUI Depth should work, but it's tricky. The way it's designed in Unity, GUI Depth sets the depth for all GUI implemented by a script. So each script can have it's own GUI Depth.

Playmaker optimizes Unity's built in GUI by combining all GUI calls in PlayMakerGUI, in one OnGUI call. This is a massive optimization, but it breaks GUI Depth. When you use the GUI Depth action it pulls those GUI calls out of PlayMakerGUI so their depth can be set separately. But again, you set the depth for all GUI in a PlayMakerFSM, not for each control (not sure if that's what you're trying to do).

Unfortunately pulling GUI out of PlayMakerGUI breaks the realtime preview of that GUI. We'll try to fix that in an update...