chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:49:36 +08:00
commit efe3a22a06
36 changed files with 1736 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
using System;
namespace ShrinkCommand
{
public static class ShrinkCommandLogger
{
public static Action<string> InfoHandler { get; set; } = DefaultInfo;
public static Action<string> WarningHandler { get; set; } = DefaultWarning;
public static Action<string> ErrorHandler { get; set; } = DefaultError;
public static Action<Exception> ExceptionHandler { get; set; } = DefaultException;
public static void Info(string message) => InfoHandler?.Invoke(message);
public static void Warn(string message) => WarningHandler?.Invoke(message);
public static void Error(string message) => ErrorHandler?.Invoke(message);
public static void Exception(Exception ex) => ExceptionHandler?.Invoke(ex);
private static void DefaultInfo(string message)
{
#if UNITY_5_3_OR_NEWER
UnityEngine.Debug.Log(message);
#else
Console.WriteLine(message);
#endif
}
private static void DefaultWarning(string message)
{
#if UNITY_5_3_OR_NEWER
UnityEngine.Debug.LogWarning(message);
#else
Console.WriteLine("[Warn] " + message);
#endif
}
private static void DefaultError(string message)
{
#if UNITY_5_3_OR_NEWER
UnityEngine.Debug.LogError(message);
#else
Console.Error.WriteLine(message);
#endif
}
private static void DefaultException(Exception ex)
{
#if UNITY_5_3_OR_NEWER
UnityEngine.Debug.LogException(ex);
#else
Console.Error.WriteLine(ex);
#endif
}
}
}