摘要: 项目开发过程中经常会用到代理事件,为方便管理,避免代码混乱,需要一个总的事件管理器: 阅读全文
posted @ 2016-12-02 20:16 土汉 阅读(425) 评论(0) 推荐(0) 编辑
摘要: /// /// 打印 /// public void PrintFile() { PrintDocument pri = new PrintDocument(); pri.PrintPage += Printpagetest; pri.Print(); } private void Printp... 阅读全文
posted @ 2016-11-14 14:52 土汉 阅读(5253) 评论(0) 推荐(0) 编辑
摘要: Android Application.dataPath : /data/app/xxx.xxx.xxx.apkApplication.streamingAssetsPath : jar:file:///data/app/xxx.xxx.xxx.apk/!/assetsApplication.per 阅读全文
posted @ 2018-04-13 20:00 土汉 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 项目中,有可能会遇到图片不是方形的。比如是圆形的。这个时候,我们希望鼠标点击到圆形的部分,才算点击。点击到方形的空白部分不算点击可能有这样的需求 我们可以按照下面步骤来处理。 原理: UGUI在处理控件是否被点击的时候,在检测图片的时候,会调用Image的IsRaycastLocationValid 阅读全文
posted @ 2018-03-26 15:18 土汉 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 1.所有展示内容全部放入Content中 2.内容区域跟滑块想自定义大小,需要把 ScrollView => ScrollRect => Visibility 设置成 Auto Hide 3.当Content动态内容使用组排列(Grid Layout Group),而Content想自适应动态内容排 阅读全文
posted @ 2017-10-24 21:05 土汉 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 虚拟仿真实验常常会用到对模型简单的旋转跟缩放。 简单实现了一下,有加阻尼效果,贴在需要旋转的模型上便可。 阅读全文
posted @ 2017-10-24 20:48 土汉 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 1.取消unity 启动编辑框 2.勾选窗体可调整大小选项 3.用脚本控制窗体大小 根据当前电脑的分辨率来控制窗体大小 获取分辨率需要引入两个动态库:System.Drawing.dll,System.Windows.Forms.dll 阅读全文
posted @ 2017-10-12 18:18 土汉 阅读(1452) 评论(0) 推荐(0) 编辑
摘要: 1 public class AudioManager : MonoBehaviour 2 { 3 4 private Dictionary _audioPool = new Dictionary(); 5 6 7 private static AudioManager _mInstance = null; 8 9 10 ... 阅读全文
posted @ 2017-03-29 16:41 土汉 阅读(151) 评论(0) 推荐(0) 编辑
摘要: public class DebugConsole : MonoBehaviour { //#if USE_DEBUGCONSOLE public GameObject DebugGui = null; // The GUI that will be duplicated public Vector3 defaultGuiPosition... 阅读全文
posted @ 2017-02-20 20:51 土汉 阅读(515) 评论(0) 推荐(0) 编辑
摘要: using System.Collections.Generic; using UnityEngine; public class Timer { //自动释放 private readonly bool autoRelease; //回调 private readonly TimerMngr.Callback func; //间隔时间 priv... 阅读全文
posted @ 2016-12-02 21:18 土汉 阅读(176) 评论(0) 推荐(0) 编辑
摘要: using System; public class Singleton where T : class, new() { private static readonly T s_Instance; static Singleton() { s_Instance = Activator.CreateInstance(); } publ... 阅读全文
posted @ 2016-12-02 21:08 土汉 阅读(152) 评论(0) 推荐(0) 编辑