当前位置: 首页>>代码示例>>C#>>正文


C# IPlatform.OnLogMessageReceived方法代码示例

本文整理汇总了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);
             };
         }
     }
 }
开发者ID:GH-AlexL,项目名称:lunar-unity-console,代码行数:13,代码来源:LunarConsole.cs

示例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;
        }
开发者ID:ashishsfb,项目名称:Save-The-Kitty,代码行数:26,代码来源:LunarConsole.cs

示例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;
        }
开发者ID:Barnaff,项目名称:Chromania,代码行数:38,代码来源:LunarConsole.cs


注:本文中的IPlatform.OnLogMessageReceived方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。