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