Hi,
yes, Bounds is a struct, you can't use it like that, you need to save it as a private variable and expose its properties individually.
Typically I solved this kind of problem with a public static dictionnary where the key is a custom string acting as a reference that you set in your action ( like arrayMaker or xmlMaker), and then other actions can use bounds by this reference key. This is the best option as far as I can see. Otherwise you need to create serializable class which create garbage collection and it's not that great...
using UnityEngine;
using System.Collections.Generic;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Terrain")]
[Tooltip("Get the local bounding box of the TerrainData object.")]
public class GetTerrainBounds : FsmStateAction
{
// you can then get to a bound using: GetTerrainBounds.BoundsLUT["My Reference"];
public static Dictionary<string, Bounds> BoundsLUT;
public Terrain terrain;
public FsmString BoundReference;
// Code that runs on entering the state.
public override void OnEnter()
{
if (BoundsLUT == null)
{
BoundsLUT = new Dictionary<string, Bounds>();
}
BoundsLUT[BoundReference.Value] = terrain.terrainData.bounds;
Finish();
}
}
}
one last option is to create scriptableObject again as a wrapp of your bound, but again you need to create them carefully and at edit time, so that they don't crate garbage collection and/or memory leak.
Bye,
Jean