Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: omgitstri on May 31, 2017, 06:27:16 PM
-
Hello,
I am currently messing around with Playmaker Template and I am trying to create a small drag & drop inventory system. I try to make it so I'd use the action 'Add Component' at the beginning of the template to make it so things would work with just the template alone and not having to worry about adding the required components each time I want to recycle the template.
The problem I'm running to right now is that the 'PlayMakerUGuiDragEventsProxy.cs' does not work very well during run-time. I add the component to the GameObject but the script does not work until I select the GameObject in the Hierarchy.
I tried [Adding the component] > [Deactivate GameObject] > [Activate GameObject] but that did not seems to help
I ran a few other tests with playmaker UGui scripts and I manage to get components like 'PlayMakerUGuiCanvasRaycastFilterEventsProxy.cs' to be added during run-time.
Tri Nguyen
-
Hi,
indeed these proxies where not design to be added at runtime.
I checked and there is a way for me to create actions for each system events, so let me work on them and I'll push a new versions, and you'll be able to catch any Unity UI events without any proxy which will be better for templates that runs on any object.
however the solution is also to simply compose your proxy by adding it to all objects potentially running your template and your template catches the default event setup on that proxy, this should work too ( but nonetheless, I like what I found on the doc on 5.6 so I'll implement it anyway)
Bye,
Jean
-
Hi,
ok, I have done all system evens as actions, so you don't have to use proxies.
https://twitter.com/JeanAtPlayMaker/status/880354132628041728
let me know how it goes, but know it should be ok to achieve what you want.
Bye,
Jean
-
Hello,
Sorry it took me almost half a year to test this out.
This is working great! Thank you for helping out.
I apologize again for taking this long to test this
Tri Nguyen
-
Hi,
no worries at all!
Bye,
Jean