playMaker

Author Topic: FsmStateAction.Log error with Coroutine[SOLVED]  (Read 1326 times)

Magicpotato

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
FsmStateAction.Log error with Coroutine[SOLVED]
« on: April 11, 2016, 06:31:51 PM »
Hello, I'm trying to use CustomAction with Coroutine while the life of the action.
There's an error on call Action.Log from Coroutine.

I made simple code.
Check and Fix please.

Code: [Select]
public class PlayMakerCoroutineTest : MonoBehaviour {
    IEnumerator Start ()
    {
        PlayMakerFSM playMakerFSM = GetComponent<PlayMakerFSM>();
        if (playMakerFSM == null)
            yield break;

        while(true)
        {
            yield return new WaitForEndOfFrame();

            if (playMakerFSM.Active == false)
                continue;
            if (playMakerFSM.Fsm == null)
                continue;
            if (playMakerFSM.Fsm.Active == false)
                continue;
            if (playMakerFSM.Fsm.ActiveState == null)
                continue;
            if (playMakerFSM.Fsm.ActiveState.Active == false)
                continue;
            if (playMakerFSM.Fsm.ActiveState.ActiveAction == null)
                continue;
            if (playMakerFSM.Fsm.ActiveState.ActiveAction.Active == false)
                continue;

            playMakerFSM.Fsm.ActiveState.ActiveAction.Log("DummyLog");

            /*
                LogAction: FsmExecutionStack.xecutingAction == null
                UnityEngine.Debug:LogError(Object)

                HutongGames.PlayMaker.FsmLog:LogAction(FsmLogType, String, Boolean)(at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmLog.cs:294)
                HutongGames.PlayMaker.FsmStateAction:Log(String)(at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmStateAction.cs:156)
                <Start>c__Iterator0:MoveNext() (at Assets/PlayMakerCoroutineTest.cs:38)
            */
        }
    }
}

Unity Info:
Unity Version: 5.3.4f1
Playmaker Version: 1.8.0.f43
BuildTarget: Android

<I deleted original link for privacy>
« Last Edit: May 23, 2016, 12:30:27 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14061
  • Official Playmaker Support
    • View Profile
Re: FsmStateAction.Log error with Coroutine
« Reply #1 on: April 19, 2016, 11:43:13 PM »
Hi,

 I think this is currently being discussed with Alex right?

 Bye,

 jean

Magicpotato

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: FsmStateAction.Log error with Coroutine
« Reply #2 on: April 19, 2016, 11:58:23 PM »
Yes, Alex is cool.
We discussed to add Action.StartCoroutine() on 1.8.1