Created
June 2, 2022 13:53
-
-
Save lucas-zimerman/22bf1426dd0204092f3defc27315427e to your computer and use it in GitHub Desktop.
Sentry CaptureMessage for Adventure Creator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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