You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
using UnityEngine;
|
|
|
|
public static class Logger
|
|
{
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void Log(object message)
|
|
{
|
|
Debug.Log(message);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void Log(object message, Object context)
|
|
{
|
|
Debug.Log(message, context);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void LogError(object message)
|
|
{
|
|
Debug.LogError(message);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void LogError(object message, Object context)
|
|
{
|
|
Debug.LogError(message, context);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void LogWarning(object message)
|
|
{
|
|
Debug.LogWarning(message);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void LogWarning(object message, Object context)
|
|
{
|
|
Debug.LogWarning(message, context);
|
|
}
|
|
|
|
[System.Diagnostics.Conditional("UNITY_EDITOR")]
|
|
public static void DrawArrow2D(Vector3 position, Vector3 direction, float arrowLength, Color color)
|
|
{
|
|
var targetPosition = position + direction.normalized * arrowLength;
|
|
Debug.DrawLine(position, targetPosition, color);
|
|
|
|
Vector3 v = Quaternion.Euler(0, 0, 45) * direction.normalized;
|
|
Debug.DrawLine(targetPosition, targetPosition - v * 0.5f, color);
|
|
|
|
v = Quaternion.Euler(0, 0, -45) * direction.normalized;
|
|
Debug.DrawLine(targetPosition, targetPosition - v * 0.5f, color);
|
|
}
|
|
}
|
|
|