当前位置:网站首页>自己封装unity的Debug函数
自己封装unity的Debug函数
2022-04-23 06:27:00 【老少年】
public static bool enableLog=true;
public static void LogWarning(string context)
{
if(enableLog)Debug.LogWarning(context);
}
public static void LogError(string context)
{
if (enableLog) Debug.LogError(context);
}
public static void Log(string context)
{
if (enableLog) Log(context,Color.white);
}
public static void Log(string context ,Color color)
{
if (enableLog) Debug.Log(string.Format("<color="+ ToHexColor(color) + ">{0}</color>", context));
}
private static string ToHexColor(Color color)
{
if (color==Color.white)
return "#000000";
string R = Convert.ToString((int)color.r*255, 16);
if (R == "0")
R = "00";
string G = Convert.ToString((int)color.g * 255, 16);
if (G == "0")
G = "00";
string B = Convert.ToString((int)color.b * 255, 16);
if (B == "0")
B = "00";
string HexColor = "#" + R + G + B;
return HexColor.ToUpper();
}
版权声明
本文为[老少年]所创,转载请带上原文链接,感谢
https://blog.csdn.net/laoshaonian/article/details/104826293
边栏推荐
- ABAP 7.4 SQL Window Expression
- js之什么是事件?事件三要素以及操作元素
- SAP TRANSLATE使用数据对象掩码示例
- SAP ECC连接SAP PI系统配置
- 判断字符串首尾是否包含目标参数:startsWith()、endsWith()方法
- The page displays the current time in real time
- Configure NPM
- Page dynamic display time (upgraded version)
- SAP PI/PO登录使用及基本功能简介
- How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)
猜你喜欢

ABAP 7.4 SQL Window Expression

将指定路径下的所有SVG文件导出成PNG等格式的图片(缩略图或原图大小)

js之节点操作,为什么要学习节点操作

Implementation of MySQL persistence

SAP CR传输请求顺序、依赖检查

ogldev-读书笔记

int a = 1存放在哪

移动端布局(3D转换、动画)

SAP PI / Po rfc2restful Publishing RFC interface as restful examples (proxy indirect)

SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
随机推荐
Thorough inquiry -- understanding and analysis of cocos2d source code
超级宝典&编程指南(红蓝宝书)-读书笔记
页面实时显示当前时间
[self motivation series] what really hinders you?
刨根问底---cocos2d源码的理解与分析
11. Table and library management
基于NLP的软件安全研究(二)
反转链表练习
SAP DEBUG调试FOR IN、REDUCE等复杂的语句
利用Lambda表达式解决c#文件名排序问题(是100大还是11大的问题)
ABAP CDS VIEW WITH ASSOCIATION示例
Two threads print odd and even numbers interactively
系统与软件安全研究(一)
H5 local storage data sessionstorage, localstorage
ABAP 7.4 SQL Window Expression
ogldev-读书笔记
快排的练习
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
反思 | Android 音视频缓存机制的系统性设计
c#读取INI文件和向ini文件写入数据