Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: giperballl on March 11, 2015, 04:15:37 AM

Title: [SOLVED]Create action from script in editor window
Post by: giperballl 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?
Title: Re: Create action from script in editor window
Post by: jeanfabre 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
Title: Re: Create action from script in editor window
Post by: giperballl 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.