123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace TFramework
- {
- /// <summary>
- /// 日志工具
- /// </summary>
- public static class Log
- {
- private readonly static string prefix = "【TFramework】:";
- /// <summary>
- /// 普通日志
- /// </summary>
- /// <param name="message"></param>
- public static void Info(this string message, GameObject obj = null)
- {
- Debug.Log($"<color=cyan>{prefix + message}</color>",obj);
- }
- /// <summary>
- /// 警告日志
- /// </summary>
- /// <param name="message"></param>
- public static void Warning(this string message, GameObject obj = null)
- {
- Debug.LogWarning($"<color=yellow>{prefix + message}</color>",obj);
- }
- /// <summary>
- /// 错误日志
- /// </summary>
- /// <param name="message"></param>
- public static void Error(this string message,GameObject obj=null)
- {
- Debug.LogError($"<color=red>{prefix + message}</color>",obj);
- }
- }
- }
|