当前位置: 首页 > news >正文

平台网站建设外包wordpress 502

平台网站建设外包,wordpress 502,在putty上怎样安装wordpress,百度推广获客成本大概多少为毛要实现这个工具? 在我小时候,每当游戏在真机运行时,我们看到的日志是这样的。 没高亮啊,还有乱七八糟的堆栈信息,好干扰日志查看,好影响心情。 还有就是必须始终连着usb线啊#xff0c;我想要想躺着测试。。。 以上种种原因,QConsole诞生了。 如何使用? 使用方式和QLog…为毛要实现这个工具? 在我小时候,每当游戏在真机运行时,我们看到的日志是这样的。 没高亮啊,还有乱七八糟的堆栈信息,好干扰日志查看,好影响心情。 还有就是必须始终连着usb线啊我想要想躺着测试。。。 以上种种原因,QConsole诞生了。 如何使用? 使用方式和QLog一样,在初始化出调用,简单的一句。 QConsole.Instance(); 复制代码就好了,使用之后效果是这样的。 在Editor模式下,F1控制开关。 在真机上需要在屏幕上同时按下五个手指就可以控制开关了。(本来考虑11个手指萌一下的)。 实现思路: 1.首先要想办法获取Log,这个和上一篇介绍的QLog一样,需要使用Application.logMessageReceived这个api。 2.获取到的Log信息要存在一个Queue或者List中,然后把Log输出到屏幕上就ok了。 3.输出到屏幕上使用的是OnGUI回调和 GUILayout.Window这个api, 总共三步。 贴上代码: QConsole实现 sing UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif using System.Collections; using System; using System.Collections.Generic;namespace QFramework {/// summary/// 控制台GUI输出类/// 包括FPS内存使用情况日志GUI输出/// /summarypublic class QConsole : QSingletonQConsole{struct ConsoleMessage{public readonly string message;public readonly string stackTrace;public readonly LogType type;public ConsoleMessage (string message, string stackTrace, LogType type){this.message message;this.stackTrace stackTrace;this.type type;}}/// summary/// Update回调/// /summarypublic delegate void OnUpdateCallback();/// summary/// OnGUI回调/// /summarypublic delegate void OnGUICallback();public OnUpdateCallback onUpdateCallback null;public OnGUICallback onGUICallback null;/// summary/// FPS计数器/// /summaryprivate QFPSCounter fpsCounter null;/// summary/// 内存监视器/// /summaryprivate QMemoryDetector memoryDetector null;private bool showGUI true;ListConsoleMessage entries new ListConsoleMessage();Vector2 scrollPos;bool scrollToBottom true;bool collapse;bool mTouching false;const int margin 20;Rect windowRect new Rect(margin Screen.width * 0.5f, margin, Screen.width * 0.5f - (2 * margin), Screen.height - (2 * margin));GUIContent clearLabel new GUIContent(Clear, Clear the contents of the console.);GUIContent collapseLabel new GUIContent(Collapse, Hide repeated messages.);GUIContent scrollToBottomLabel new GUIContent(ScrollToBottom, Scroll bar always at bottom);private QConsole(){this.fpsCounter new QFPSCounter(this);this.memoryDetector new QMemoryDetector(this);// this.showGUI App.Instance().showLogOnGUI;QApp.Instance().onUpdate Update;QApp.Instance().onGUI OnGUI;Application.logMessageReceived HandleLog;}~QConsole(){Application.logMessageReceived - HandleLog;}void Update(){#if UNITY_EDITORif (Input.GetKeyUp(KeyCode.F1))this.showGUI !this.showGUI;#elif UNITY_ANDROIDif (Input.GetKeyUp(KeyCode.Escape))this.showGUI !this.showGUI;#elif UNITY_IOSif (!mTouching Input.touchCount 4){mTouching true;this.showGUI !this.showGUI;} else if (Input.touchCount 0){mTouching false;}#endifif (this.onUpdateCallback ! null)this.onUpdateCallback();}void OnGUI(){if (!this.showGUI)return;if (this.onGUICallback ! null)this.onGUICallback ();if (GUI.Button (new Rect (100, 100, 200, 100), 清空数据)) {PlayerPrefs.DeleteAll ();#if UNITY_EDITOREditorApplication.isPlaying false;#elseApplication.Quit();#endif}windowRect GUILayout.Window(123456, windowRect, ConsoleWindow, Console);}/// summary/// A window displaying the logged messages./// /summaryvoid ConsoleWindow (int windowID){if (scrollToBottom) {GUILayout.BeginScrollView (Vector2.up * entries.Count * 100.0f);}else {scrollPos GUILayout.BeginScrollView (scrollPos);}// Go through each logged entryfor (int i 0; i entries.Count; i) {ConsoleMessage entry entries[i];// If this message is the same as the last one and the collapse feature is chosen, skip itif (collapse i 0 entry.message entries[i - 1].message) {continue;}// Change the text colour according to the log typeswitch (entry.type) {case LogType.Error:case LogType.Exception:GUI.contentColor Color.red;break;case LogType.Warning:GUI.contentColor Color.yellow;break;default:GUI.contentColor Color.white;break;}if (entry.type LogType.Exception){GUILayout.Label(entry.message || entry.stackTrace);} else {GUILayout.Label(entry.message);}}GUI.contentColor Color.white;GUILayout.EndScrollView();GUILayout.BeginHorizontal();// Clear buttonif (GUILayout.Button(clearLabel)) {entries.Clear();}// Collapse togglecollapse GUILayout.Toggle(collapse, collapseLabel, GUILayout.ExpandWidth(false));scrollToBottom GUILayout.Toggle (scrollToBottom, scrollToBottomLabel, GUILayout.ExpandWidth (false));GUILayout.EndHorizontal();// Set the window to be draggable by the top title barGUI.DragWindow(new Rect(0, 0, 10000, 20));}void HandleLog (string message, string stackTrace, LogType type){ConsoleMessage entry new ConsoleMessage(message, stackTrace, type);entries.Add(entry);}} } 复制代码QFPSCounter using UnityEngine; using System.Collections;namespace QFramework {/// summary/// 帧率计算器/// /summarypublic class QFPSCounter{// 帧率计算频率private const float calcRate 0.5f;// 本次计算频率下帧数private int frameCount 0;// 频率时长private float rateDuration 0f;// 显示帧率private int fps 0;public QFPSCounter(QConsole console){console.onUpdateCallback Update;console.onGUICallback OnGUI;}void Start(){this.frameCount 0;this.rateDuration 0f;this.fps 0;}void Update(){this.frameCount;this.rateDuration Time.deltaTime;if (this.rateDuration calcRate){// 计算帧率this.fps (int)(this.frameCount / this.rateDuration);this.frameCount 0;this.rateDuration 0f;}}void OnGUI(){GUI.color Color.black;GUI.Label(new Rect(80, 20, 120, 20),fps: this.fps.ToString()); }}} 复制代码QMemoryDetector using UnityEngine; using System.Collections;namespace QFramework {/// summary/// 内存检测器目前只是输出Profiler信息/// /summarypublic class QMemoryDetector {private readonly static string TotalAllocMemroyFormation Alloc Memory : {0}M;private readonly static string TotalReservedMemoryFormation Reserved Memory : {0}M;private readonly static string TotalUnusedReservedMemoryFormation Unused Reserved: {0}M;private readonly static string MonoHeapFormation Mono Heap : {0}M;private readonly static string MonoUsedFormation Mono Used : {0}M;// 字节到兆private float ByteToM 0.000001f;private Rect allocMemoryRect;private Rect reservedMemoryRect;private Rect unusedReservedMemoryRect;private Rect monoHeapRect;private Rect monoUsedRect;private int x 0;private int y 0;private int w 0;private int h 0;public QMemoryDetector(QConsole console){this.x 60;this.y 60;this.w 200;this.h 20;this.allocMemoryRect new Rect(x, y, w, h);this.reservedMemoryRect new Rect(x, y h, w, h);this.unusedReservedMemoryRect new Rect(x, y 2 * h, w, h);this.monoHeapRect new Rect(x, y 3 * h, w, h);this.monoUsedRect new Rect(x, y 4 * h, w, h);console.onGUICallback OnGUI;}void OnGUI(){GUI.Label(this.allocMemoryRect, string.Format(TotalAllocMemroyFormation, Profiler.GetTotalAllocatedMemory() * ByteToM));GUI.Label(this.reservedMemoryRect, string.Format(TotalReservedMemoryFormation, Profiler.GetTotalReservedMemory() * ByteToM));GUI.Label(this.unusedReservedMemoryRect, string.Format(TotalUnusedReservedMemoryFormation, Profiler.GetTotalUnusedReservedMemory() * ByteToM));GUI.Label(this.monoHeapRect,string.Format(MonoHeapFormation, Profiler.GetMonoHeapSize() * ByteToM));GUI.Label(this.monoUsedRect,string.Format(MonoUsedFormation, Profiler.GetMonoUsedSize() * ByteToM));}}} 复制代码注意事项: 和上一篇介绍的QLog一样,需要依赖上上篇文章介绍的QApp。 QConsole初步实现来自于开源Unity插件Unity-WWW-Wrapper中的Console.cs.在此基础上添加了ScrollToBottom选项。因为这个插件的控制台不支持滚动显示Log,需要拖拽右边的scrollBar,很不方便。 Unity-WWW-wrapper非常不稳定,建议大家不要使用。倒是感兴趣的同学可以研究下实现,贴上地址:https://www.assetstore.unity3d.com/en/#!/content/19116。 欢迎讨论! 相关链接: 我的框架地址:https://github.com/liangxiegame/QFramework 教程源码:https://github.com/liangxiegame/QFramework/tree/master/Assets/HowToWriteUnityGameFramework/ QFramework游戏框架搭建QQ交流群: 623597263 转载请注明地址:凉鞋的笔记http://liangxiegame.com/ 微信公众号:liangxiegame 如果有帮助到您: 如果觉得本篇教程对您有帮助不妨通过以下方式赞助笔者一下鼓励笔者继续写出更多高质量的教程也让更多的力量加入 QFramework 。 购买 gitchat 话题《Unity 游戏框架搭建资源管理 与 ResKit 精讲》 价格: 6 元会员免费地址: http://gitbook.cn/gitchat/activity/5b29df073104f252297a779c给 QFramework 一个 Star 地址: https://github.com/liangxiegame/QFramework给 Asset Store 上的 QFramework 并给个五星(需要先下载) 地址: http://u3d.as/SJ9购买 gitchat 话题《Unity 游戏框架搭建我所理解的框架》 价格: 6 元会员免费地址: http://gitbook.cn/gitchat/activity/5abc3f43bad4f418fb78ab77购买同名电子书 :https://www.kancloud.cn/liangxiegame/unity_framework_design( 29.9 元内容会在 2018 年 10 月份完结)
http://www.yutouwan.com/news/365649/

相关文章:

  • 专业购物网站定制淮北矿业工程建设公司网站
  • 东莞清洁服务网站建设未来的软件开发方向是什么
  • 杭州微网站建设公司哪家好网站开发相关技术
  • 数据百度做网站好用吗济源市建设网站
  • 邯郸网站建设选哪家郑州第一附属医院不孕不育科
  • 好的策划方案网站做h5页面网站有哪些
  • 怎么做网站搜索引擎大良营销网站建设市场
  • 创建免费论坛的10个网站郑州seo排名优化
  • 金融网站建设银行四川做网站设计公司价格
  • 做网站美工未来规划百科网站模板
  • 北海网站制作公司柳州建设网官方网站
  • 企业网站是什么一家专门做母婴的网站
  • 做的网站显示不了背景图片wordpress电商主题完成度
  • 知名跟单网站做信号提供方如何开发电子商务网站
  • 什么是网站静态化怎样做网站跳转
  • 建设银行互联网网站首页定远网站开发
  • 淘宝网站怎样建阿里云网站域名备案
  • html5 图片网站模板免费商务网
  • react做的电商网站能上线吗wordpress+博客主题
  • 汕头做网站多少钱做网站动态效果心得
  • 养老院网站建设方案prestashop和wordpress
  • 做网站一定要用到dw做网站网站如何定位
  • 河北seo技术网站建设或网站优化排名
  • 做公司网站的步骤网站开发心得
  • 提供专业网站建设地推团队如何收费
  • 河南网站开发茶文化网站建设规划书范文
  • 网站怎么做赚钱专业做图片制作网站
  • 郑州冬青街 网站建设三牛网站建设
  • 网页设计与制作个人网站昆山建设招投标网站
  • 汪峰做的音乐网站济南市建设工程招标网官网