DirtyHippy
New member
I have a simple action task that has an enum and a sharedfloat. It simply looks up the value based on the enum and puts it in the shared var. Since I tended to use multiple of these in a sequence, I figured I would create a separate task with a little serializable list of these where each serializable entry was simply the enumeration and a sharedfloat.
However, this doesn't seem to work - I don't see the values changing in the behaviour variables list.
So then I figured there must be some sort of mapping going on, probably via reflection on startup, to identify these fields. So I looked in the assembly source and tried this in OnAwake () for this node (where MyVariableEntries are a simply class with an enum and a SharedFloat (called TargetVariable).
But this doesn't appear to work either when I assign something to TargetVariable. Is there a way to do this or should I just stick to single nodes?
However, this doesn't seem to work - I don't see the values changing in the behaviour variables list.
So then I figured there must be some sort of mapping going on, probably via reflection on startup, to identify these fields. So I looked in the assembly source and tried this in OnAwake () for this node (where MyVariableEntries are a simply class with an enum and a SharedFloat (called TargetVariable).
Code:
var behaviourSource = Owner.GetBehaviorSource ();
for (int index = 0, count = MyVariableEntries.Count; index < count; index++)
MyVariableEntries [index].TargetVariable.InitializePropertyMapping (behaviourSource);
But this doesn't appear to work either when I assign something to TargetVariable. Is there a way to do this or should I just stick to single nodes?