本文整理汇总了C#中IPlatform.OnLogMessageReceived方法的典型用法代码示例。如果您正苦于以下问题:C# IPlatform.OnLogMessageReceived方法的具体用法?C# IPlatform.OnLogMessageReceived怎么用?C# IPlatform.OnLogMessageReceived使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlatform
的用法示例。
在下文中一共展示了IPlatform.OnLogMessageReceived方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitPlatform
void InitPlatform(int capacity)
{
if (platform == null)
{
platform = CreatePlatform(capacity);
if (platform != null)
{
Application.logMessageReceivedThreaded += delegate(string message, string stackTrace, LogType type) {
platform.OnLogMessageReceived(message, stackTrace, type);
};
}
}
}
示例2: InitPlatform
bool InitPlatform(int capacity, int trim)
{
try
{
if (platform == null)
{
trim = Math.Min(trim, capacity); // can't trim more that we have
platform = CreatePlatform(capacity, trim);
if (platform != null)
{
Application.logMessageReceived += delegate(string message, string stackTrace, LogType type) {
platform.OnLogMessageReceived(message, stackTrace, type);
};
return true;
}
}
}
catch (Exception e)
{
Debug.LogError("Can't init " + Constants.PluginName + ": " + e.Message);
}
return false;
}
示例3: InitPlatform
bool InitPlatform(int capacity, int trim)
{
try
{
if (m_platform == null)
{
trim = Math.Min(trim, capacity); // can't trim more that we have
m_platform = CreatePlatform(capacity, trim);
if (m_platform != null)
{
m_queuedMessages = new Queue<MessageInfo>();
int mainThreadId = Thread.CurrentThread.ManagedThreadId;
Application.logMessageReceivedThreaded += delegate(string message, string stackTrace, LogType type)
{
message = m_removeRichTextTags ? StringUtils.RemoveRichTextTags(message) : message;
if (Thread.CurrentThread.ManagedThreadId == mainThreadId)
{
m_platform.OnLogMessageReceived(message, stackTrace, type);
}
else
{
QueueMessage(message, stackTrace, type);
}
};
return true;
}
}
}
catch (Exception e)
{
Debug.LogError("Can't init " + Constants.PluginName + ": " + e.Message);
}
return false;
}