Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: MAX_POWER on February 11, 2018, 07:17:20 AM

Title: Clearing a generic list. [SOLVED]
Post by: MAX_POWER on February 11, 2018, 07:17:20 AM
I'm using the TriggerEventOncePerObject.cs script and it's using a generic list. (List<GameObject> alreadyHit = new List<GameObject>();)

Is there a way to clear this list with another action in another state? I know it should be as easy as alreadyHit.Clear(); but I don't know how to create an action like that. Or is there a way to already do it somehow? Thanks.
Title: Re: Clearing a generic list.
Post by: djaydino on February 11, 2018, 07:38:18 AM
Hi.
I have added a "Reset" bool where you can place a variable and you can set that bool to true on a different state.
Then when TriggerEventOncePerObject is called again it will check if that bool is true and reset the list + set it back to false.

Can you try if it works as you want?
Title: Re: Clearing a generic list.
Post by: MAX_POWER on February 12, 2018, 02:35:08 AM
Hi.
I have added a "Reset" bool where you can place a variable and you can set that bool to true on a different state.
Then when TriggerEventOncePerObject is called again it will check if that bool is true and reset the list + set it back to false.

Can you try if it works as you want?

Sounds absolutely fantastic. Yes I'm willing try to it out. Just let me know where to download the script. Thanks!
Title: Re: Clearing a generic list.
Post by: djaydino on February 12, 2018, 04:04:25 AM
Hi.
Just get it again from the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) :)
Title: Re: Clearing a generic list.
Post by: MAX_POWER on February 12, 2018, 04:40:14 AM
Works like a charm now. It's just fantastic to see somebody doing an update so fast.  Thank you so much!
Title: Re: Clearing a generic list.
Post by: djaydino on February 12, 2018, 04:52:46 AM
Hi,
Happy to help :D