Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: Marsh on December 27, 2013, 12:17:58 PM

Title: Debug Log Any FSM Variable To Screen
Post by: Marsh on December 27, 2013, 12:17:58 PM
Just a simple script I use to help myself debug. Thought id share it. All Credit goes to Jeremy Hollingsworth.

This action will Debug any FsmVariable to the screen instead of the console. This is handy if you are trying to debug on iOS or android devices and may not have xcode or logcat handy.

Step 1:
Download this:
Author: Jeremy Hollingsworth (jeremyace)
http://wiki.unity3d.com/index.php/DebugConsole

Step 2:
Create a new C# Script and enter this code

Code: [Select]
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Debug)]
[Tooltip("Debug logs to the screen instead of the console.")]
public class ConsoleDebugLogPlayMaker : FsmStateAction
{

[Tooltip("Info, Warning, or Error.")]
[RequiredField]
public LogLevel LogLevel;


[Tooltip("Variable to debug")]
[RequiredField]
public FsmVar info;



public override void Reset()
{

}

public override void OnEnter()
{
DebugConsole.Log( info.GetValue().ToString(), LogLevel.ToString());
}

}
}

(http://i.imgur.com/o0mAOCN.png)
Title: Re: Debug Log Any FSM Variable To Screen
Post by: jeanfabre on December 28, 2013, 03:00:16 AM
Hi,

 Very interesting!

bye,

 Jean