Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Budde88 on August 09, 2017, 07:38:19 AM

Title: NGUITools.Destroy - REQUEST[SOLVED]
Post by: Budde88 on August 09, 2017, 07:38:19 AM
Hey Devs,

So basically we have the NGUITools.Addchild action that allows us to spawn prefabs into NGUI tables, but we don't have NGUITools.Destroy to destroy items in tables.
The regular destroy action doesn't work as mentioned here.

http://www.tasharen.com/forum/index.php?topic=12175.0

Thanks
Title: Re: NGUITools.Destroy - REQUEST
Post by: Deek on August 09, 2017, 12:45:53 PM
Here you have it (see attachment).
With this you can select several GameObjects within one action. If one of the GameObjects doesn't have any NGUI component, it gets destroyed normally, so you can use this action for all of your destructible needs ;)

Optionally repositions afterwards or only destroy the children of the specified GameObjects.
Tested it with several scenarios, but if you find any bugs or wish for different/additional functionalities, let me know.

I also have created more custom NGUI actions which you can find here:
http://hutonggames.com/playmakerforum/index.php?topic=15458.0
Including NGUIToolsAddChildAdvanced, with which you can set the name, position, rotation and scale of your freshly created instance immediately in the same action; that I find to be very helpful.

Keep in mind that there is also a "Request Action" section in this forum, just saying  ::)
Title: Re: NGUITools.Destroy - REQUEST
Post by: Budde88 on August 09, 2017, 12:50:50 PM
Wow, that was fast!

Thank you so much, I usually post on the request forum, but that part is a lot quieter ;)

I will def check out the link too as NGUI actions are priceless for my development process.
Title: Re: NGUITools.Destroy - REQUEST
Post by: Deek on August 09, 2017, 01:03:41 PM
Always glad when I can help, especially when it comes to actions for third party assets, since there aren't a lot of people out there that use both PlayMaker and those assets and have the expertise in creating custom actions or coding in general.