playMaker

Author Topic: Migrating Action data when refactoring actions  (Read 781 times)

kLy

  • Playmaker Newbie
  • *
  • Posts: 9
Migrating Action data when refactoring actions
« on: November 25, 2021, 04:54:12 PM »
Hi

I'd like to migrate data when updating the fields of an Action that I've written. Unity for example has an attribute called FormerlySerializedAs that's designed for this. Does Playmaker offer some way to do this?

Specifically, I'm updating a field from a FsmOwnerDefault field to a simple FsmGameObject field.

Currently I'm trying to call a method like this:

Code: [Select]
        var go = Fsm.GetOwnerDefaultTarget(OldField);
       
        if (go != null && NewField.Value == null)
        {
        NewField.Value = go;
        OldField.OwnerOption = OwnerDefaultOption.SpecifyGameObject;
        OldField.GameObject.Value = null;
        }

I'm trying to call this from Reset, Awake, OnPreprocess, and InitEditor but none of those seem to have the desired result.

Any decent way I can do this?

Thanks! :)