playMaker

Author Topic: Clearing a generic list. [SOLVED]  (Read 2894 times)

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 40
Clearing a generic list. [SOLVED]
« 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.
« Last Edit: February 12, 2018, 04:53:02 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Clearing a generic list.
« Reply #1 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?

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Clearing a generic list.
« Reply #2 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!
« Last Edit: February 12, 2018, 02:37:49 AM by MAX_POWER »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Clearing a generic list.
« Reply #3 on: February 12, 2018, 04:04:25 AM »
Hi.
Just get it again from the Ecosystem :)

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Clearing a generic list.
« Reply #4 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!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Clearing a generic list.
« Reply #5 on: February 12, 2018, 04:52:46 AM »
Hi,
Happy to help :D