playMaker

Author Topic: [SOLVED]Create action from script in editor window  (Read 1788 times)

giperballl

  • Playmaker Newbie
  • *
  • Posts: 3
[SOLVED]Create action from script in editor window
« on: March 11, 2015, 04:15:37 AM »
Hello, I'm doing editor window for Unity and through this window I create actions from script. at the moment I do it like this:

Code: [Select]
        //get actions array
        FsmStateAction[] actions = state.Actions;
        //set action information
        action.Fsm = state.Fsm;
        action.Owner = state.Fsm.GameObject;
        action.State = state;
        //resize array of actions
        System.Array.Resize<FsmStateAction>(ref actions, actions.Length + 1);
        actions[actions.Length - 1] = action;
        //save actions in state
        state.Actions = actions;
        //update actions data
        state.ActionData.SaveActions(actions);

But when I run fsm, the process stops on created by me actions. If I go into action editor and change any value by hands (even if it is the same value) fsm works normally without stopping. Maybe there is a way that allows create the correct action?
« Last Edit: March 28, 2015, 05:32:52 PM by giperballl »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15537
  • Official Playmaker Support
Re: Create action from script in editor window
« Reply #1 on: March 13, 2015, 02:41:32 AM »
Hi,

 I don't have any experience with this kind of usage. Hopefully someone will step up with a solution.

 Bye,

Jean

giperballl

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Create action from script in editor window
« Reply #2 on: March 28, 2015, 05:32:18 PM »
I solved this problem. The problem was not in all actions, but only iTween. I do not reset the variable "speed" and it turned out that the execution time is infinite.