
unity
一行注释也不写
程序大白
展开
-
vscode打开unity项目时排除.meta文件
vscode打开unity项目会显示.meta文件,这样很影响查看文件,为了直观好看,我们需要设置排除.meta文件。1 选择 首选项 --> 设置2 选择 常规设置 找到 Files: Exclude 选项3 点击 添加模式 输入 **/*.meta 确定.meta 文件就在工程里看不到了...原创 2021-07-19 17:34:12 · 1587 阅读 · 1 评论 -
Unity报错 The type or namespace name `CrossPlatformInput’ does
解决方法:在AssetStore中找到Standard Assets,下载并导入到项目中原创 2020-01-11 02:01:03 · 1451 阅读 · 0 评论 -
unity Application.CaptureScreenshot 废弃
修改为ScreenCapture.CaptureScreenshot原创 2020-01-03 14:09:06 · 1146 阅读 · 0 评论 -
unity5.6.3在mac下无法创建新工程
退出账号,重新登录,即可新建工程原创 2018-01-19 11:13:01 · 707 阅读 · 0 评论 -
unity 提升画质的几种方法
1 在unity的 QualitySettings 里 的Texture Quality 贴图质量设置成 Full Res 2 在unity的 QualitySettings 里 的Anti Aliasing 抗锯齿 打开 3 在unity的 QualitySettings 里 Pixel light count 区域光数不要设置成0 4 给camera 添加 HDR原创 2017-10-10 14:57:40 · 15441 阅读 · 0 评论 -
unity判断联网
if (Application.internetReachability == NetworkReachability.NotReachable) { Debugger.Log (“没有联网!!!”); } if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork) { D原创 2017-10-10 18:16:17 · 433 阅读 · 0 评论 -
Unity中Invoke 和 InvokeRepeating
Invoke() 方法是 Unity3D 的一种委托机制如: Invoke(“Test”, 5); 它的意思是:5 秒之后调用 Test() 方法;使用 Invoke() 方法需要注意 3点:1 :它应该在 脚本的生命周期里的(Start、Update、OnGUI、FixedUpdate、LateUpdate)中被调用;2:Invoke(); 不能接受含有参数的方法;3:在 Time.Scale原创 2017-10-10 18:01:06 · 649 阅读 · 0 评论 -
unity设置游戏帧率
Application.targetFrameRate = 30; Application.targetFrameRate = -1; //不限坑Application.targetFrameRate 是用来让游戏以指定的帧率运行,如果设置为 -1 就让游戏以最快的速度运行。 但是 这个 设定会 垂直同步 影响。 如果设置了垂直同步,那么 就会抛弃这个设定 而根据 屏幕硬件的刷新速度来运行原创 2017-10-10 17:52:56 · 1808 阅读 · 0 评论 -
unity设置屏幕不锁屏
Screen.sleepTimeout = (int)SleepTimeout.NeverSleep;原创 2017-10-10 17:33:15 · 2756 阅读 · 0 评论 -
CommandInvokationFailure: Unable to convert classes into dex format解决方法
在Android工程导入unity调用时报此错 问题原因是Android工程里有unity的class.jar 引用包重复 解决方法,导出Android的jar时,只勾选src原创 2017-09-06 16:23:12 · 1153 阅读 · 0 评论 -
BCE0048: Type 'UnityEngine.Component' does not support slicing.
解决方法:将animation改成GetComponent.() GetComponent.<Animation>()["idle"].speed = Random.Range(0,2.0); //animation["idle"].speed = Random.Range(0,2.0);原创 2017-07-29 01:44:44 · 2033 阅读 · 0 评论 -
error CS1061: Type `UnityEngine.Mesh' does not contain a definition for `GetTriangleStrip' and no ex
把GetTriangleStrip改成GetTriangles,对应着SetTriangleStrip也要改成SetTriangles。原创 2017-07-28 02:07:40 · 7016 阅读 · 0 评论 -
Unity4.x 天空盒子升级5.x显示混乱
解决方式: 找到项目中“标准资源”(Standard Assets),点击天空盒子的材质,出现提示信息“This texture contains alpha, but is not RGBM(Incompatible with HDR[高动态光照渲染])”点击“Fix Now”进行自己主动修复就可以。原创 2017-07-28 00:13:15 · 1398 阅读 · 0 评论 -
Destroy may not be called from edit mode! Use DestroyImmediate instead. Also think twice if you real
Destroy may not be called from edit mode! Use DestroyImmediate instead. Also think twice if you real编辑模式下 不能调用Destroy,请使用 DestroyImmediate 。原创 2017-07-27 23:54:30 · 3132 阅读 · 1 评论 -
CameraMotionBlurEditor 在uinty5.x 报错
Ambiguous reference 'preview': CameraMotionBlurEditor.preview, UnityEditor.Editor.preview.需要把var preview : SerializedProperty; 改为 var preview_ : SerializedProperty;原创 2017-07-27 23:51:55 · 1277 阅读 · 0 评论 -
unity GUI中输出log
先上代码: class MyDebug : MonoBehaviour { static List<string> messages = new List<string>(); static List<string> names = new List<string>(); public Rect rect; public float IntervalSi原创 2016-09-09 16:25:49 · 1537 阅读 · 0 评论 -
unity发布Android默认启动类
unity做Android项目时,会需要知道启动类的名称。包名我们是可以在发布设置里修改的,但启动类unity中时固定的。原创 2016-04-20 15:12:45 · 872 阅读 · 0 评论 -
unity Package
Package原创 2016-04-25 11:50:45 · 490 阅读 · 0 评论