Hi,
I've built some UI, with menus, buttons, panels and all that.
I use effects for their activation and deactivation (DoTweens, which include a nice "TO/FROM" switch so you can build your entire UI and leave the panels where they're meant to show up on the screen).
The opening effects are launched when the object is activated.
The closing effects are waiting, in the same FSM, for some specific events like CLOSE from a closing button, etc., to be ran.
But once an UI element has been hidden from the screen, I need to reset its values so the next time it's activated/called, the tweens will work flawlessly.
For that, I had to transform my entire UI into a mass of prefabs, so I could revert to an UI element's original state before activation. But now I need to find a way to do that resetting.
Here I found the following answer:
Make your object an prefab and try
UnityEditor.PrefabUtility.ResetToPrefabState(this.gameObject)
It not seems to work for me though, but the docs says "Resets the properties of the component or game object to the parent prefab state"
Is there a way to make this work in PlayMaker? Is there an action that can do that already?
This would be almost similar to option #2 described
in this thread but without creating/destroying UI elements; today it's impossible because uGUI uses its rectTransforms and there's no way I know of to create an uGUI element from a prefab and place it on screen, and anyway I'd rather not destroy elements but simply deactivate them.