playMaker

Author Topic: Debug Log Any FSM Variable To Screen  (Read 3770 times)

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable
Debug Log Any FSM Variable To Screen
« 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());
}

}
}

« Last Edit: December 27, 2013, 12:20:24 PM by Marsh »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Debug Log Any FSM Variable To Screen
« Reply #1 on: December 28, 2013, 03:00:16 AM »
Hi,

 Very interesting!

bye,

 Jean