09 2020 档案
摘要:public T CreateObj<T>(string className) where T:class { Type type = Type.GetType(className); return Activator.CreateInstance(type) as T; }
阅读全文
摘要:unityAnimationCurv曲线变量很好的为我们提供了一个极其方便的数学曲线工具,比如刷怪的时间间隔随着时间的增长,呈现一个多样性的变化,而AnimationCurve便很好的做到了这一点 using System.Collections; using System.Collections.
阅读全文
摘要:System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 开始监视代码运行时间 stopwatch.Stop(); // 停止监视 TimeSpan timespan = stopwatch.Ela
阅读全文
摘要:最近一直想面对大规模程序时,如何提高运算速度,100个怪物循环100次没有问题,但是处理的过程会特别庞大,所以考虑到使用多线程,unity的单线程,而unity自带的dots系统也不知道什么时候成熟,不想造轮子所以jobsystem真心不想用,在网上偶然间看到了一个关于鸟群算法对Computesha
阅读全文
摘要:当Canvas.RenderMode为Screen Space-Overlay时 利用WorldToScreenPoint(worldPos)将物体的世界坐标转换成屏幕坐标,实时更新UI的坐标: using UnityEngine; using System.Collections; public
阅读全文