Skip to content

Instantly share code, notes, and snippets.

@lucas-zimerman
Created June 2, 2022 13:53
Show Gist options
  • Save lucas-zimerman/22bf1426dd0204092f3defc27315427e to your computer and use it in GitHub Desktop.
Save lucas-zimerman/22bf1426dd0204092f3defc27315427e to your computer and use it in GitHub Desktop.
Sentry CaptureMessage for Adventure Creator
using AC;
using Sentry;
#if UNITY_EDITOR
using UnityEditor;
#endif
[System.Serializable]
public class ActionSentryCaptureMessage : Action
{
public override ActionCategory Category { get { return ActionCategory.Custom; } }
public override string Title { get { return "Sentry Capture Message"; } }
public override string Description { get { return "Logs a message with a given level."; } }
public string message;
public SentryLevel severity;
public override float Run()
{
SentrySdk.CaptureMessage(message, severity);
isRunning = false;
return 0f;
}
#if UNITY_EDITOR
public override void ShowGUI()
{
severity = (SentryLevel)EditorGUILayout.EnumPopup("Level", severity);
message = EditorGUILayout.TextField("Message", message);
}
public override string SetLabel() => string.Empty;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment