List (Array)

Arbor data flow supports lists (arrays).
Please use the behavior of each operation node and state for access.

The following is an example of randomly extracting elements from the list set in ParameterContainer.

  • Added StringList parameter to graph parameters.
  • Get with GetParameter.
  • Add the List.Count operation node to get the number of elements in the string type list.
  • Calculate the random index using the number of elements in the obtained list.
  • Gets a list element by random index.
  • Added SelectString parameter to graph parameters.
  • Set the retrieved random element in the SelectString parameter.
  • Repeat at 1 second intervals with a TimeTransition to see it change randomly.

Use a calculation node to obtain various data that does not change the elements of List.

Use state behaviors to modify List elements.

Due to restrictions in the precompiled environment such as IL2CPP build, an exception will occur when using List<T> that is not referenced from the code.

See Unity - Manual: Scripting restrictions for more information on precompilation limits.

Here's how to use it that causes problems with Arbor.

  • Parameter
    • AssetObjectList
    • ComponentList
    • EnumList
  • List-related built-in scripts

To avoid such AOT problems, add code similar to the following.

1
2
3
4
5
6
7
using System.Collections.Generic;

public class AOTCodeGeneration
{
	// For example, if you create a Foo type but List<Foo> is not used in your code.
	public List<Foo> myStructList = new List<Foo>();
}

You do not need to use the AOTCodeGeneration class.
Writing in a script like this will ensure that the compiler will generate the appropriate code.