Author Topic: Unity List to Array or ArrayMaker  (Read 842 times)


  • Hero Member
  • *****
  • Posts: 660
    • View Profile
Unity List to Array or ArrayMaker
« on: June 08, 2017, 07:08:19 AM »
I am creating action for opsives third person controller (can be found here:

There is a method that returns a list of inventory items. I am trying to figure out how to get that list into a playmaker FSM array or arraymaker array.

void Opsive.ThirdPersonController.Inventory.GetAvailableItems ( ref List< ItemType >    itemTypes)   

Returns a list of items which are currently available in the inventory.
itemTypes The list of items which are currently available.


Any ideas or examples?


  • Playmaker Newbie
  • *
  • Posts: 14
    • View Profile
Re: Unity List to Array or ArrayMaker
« Reply #1 on: June 11, 2017, 07:22:31 AM »
I have found the easiest way to do this is to loop through the list then assign it to the ArrayList.

1) Get the proxy from the game object:

Code: [Select]
PlayMakerArrayListProxy goProxy = go.GetComponents<PlayMakerArrayListProxy>()
2) Then loop through the List with a foreach and add the info:
Code: [Select]
foreach (var item in list) {

The key here is the _arraylist. It is what is exposed to access the arraylist data itself.

Hope this helps,