随笔分类 -  Unity

Unity学习和开发中常见问题
摘要:官方文档 https://docs.unity3d.com/cn/2020.3/Manual/webgl-deploying.html#content_encoding_header 开启解压缩回退Decompression Fallback 在这里设置 效果 最后打包的文件Build里面就是.un 阅读全文
posted @ 2025-06-02 02:24 Excel2016 阅读(202) 评论(0) 推荐(0)
摘要:使用 CharacterController 后 , 坐标系统会变得混乱,各系统之间使用自己的缓存来保持数据,玩家为了模拟重力 不得不持续进行运算。 这样就会令其他坐标操作指令出现无效化或者混乱 unity 也提供了一个简单的解决方案 就是每计算一次之前 都去同步其他坐标操作的结果 Physics. 阅读全文
posted @ 2023-04-18 01:03 Excel2016 阅读(236) 评论(0) 推荐(0)
摘要:定时任务类 using System.Collections; using System.Collections.Generic; using UnityEngine; public delegate void TimeTaskDelegate(); /// <summary> /// 定时任务类 阅读全文
posted @ 2022-03-30 11:29 Excel2016 阅读(253) 评论(0) 推荐(0)
摘要:我的路径 C:\Users\ak470\AppData\Local\Unity\cache\packages\packages.unity.cn 这个路径根据用户名自己替换 根据是国际版还是中国版,在C:\Users\ak470\AppData\Local\Unity\cache\packages 阅读全文
posted @ 2022-03-23 09:09 Excel2016 阅读(782) 评论(0) 推荐(0)
摘要:之前做的都是摄像机绕某个物体旋转。直接修改的Rotation属性 然后缩放用的是改摄像机FieldOfView的值 最后发觉效果不仅不尽如人意而且平移后会错位。在借鉴了一个别人的摄像机代码后修改成功 按住右键旋转,按住中键平移,滚轮缩放 脚本拖放到摄像机上即可 代码如下 using DG.Tween 阅读全文
posted @ 2022-03-02 16:52 Excel2016 阅读(700) 评论(1) 推荐(0)
摘要:一般版本说明 Final:最终版。 当前时间的一个最终版本,可能包含新的功能以及API的变更,详细信息可以参考发布说明。一般大的功能跨度都是在年度版本进行更新。 LTS:长期稳定支持版 。 LTS版本不会有新的任何功能,API变更或改进。不过次版本会解决崩溃,回归测试和开发者反馈的相关问题。 适用于 阅读全文
posted @ 2022-02-22 15:07 Excel2016 阅读(1594) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/weixin_42304838/article/details/117550474 阅读全文
posted @ 2022-02-20 21:55 Excel2016 阅读(2261) 评论(0) 推荐(0)
摘要:解决方法 https://www.freesion.com/article/1592559347/ 阅读全文
posted @ 2022-02-18 17:20 Excel2016 阅读(284) 评论(0) 推荐(0)
摘要:using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class CameraC 阅读全文
posted @ 2022-02-11 11:16 Excel2016 阅读(648) 评论(0) 推荐(0)
摘要:using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class FollowCamera : MonoBehaviour { //主摄像 阅读全文
posted @ 2021-12-20 08:48 Excel2016 阅读(237) 评论(0) 推荐(0)
摘要:1.扫描所有场景,保存并添加到Build Settings中 using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; usin 阅读全文
posted @ 2021-12-09 12:13 Excel2016 阅读(615) 评论(0) 推荐(0)
摘要:// Unity中反射遍历命名空间的两种方法 // 1. foreach (Type currType in GetType().Assembly.GetTypes()) { Debug.Log(currType); Debug.Log(currType.Namespace); } // 2. As 阅读全文
posted @ 2021-11-16 15:58 Excel2016 阅读(225) 评论(0) 推荐(0)
摘要:using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using Object = UnityEngine.Obje 阅读全文
posted @ 2021-11-09 16:24 Excel2016 阅读(389) 评论(0) 推荐(0)
摘要:使用Unity发布WebGL项目免不了要与Js进行通信,所以整理下相关知识。 官方文档地址 一 Unity调用Js方法 1.弃用的方法 (1)在发布的WebGL项目的index.html添加Exit函数: function Exit() { alert("UnityToWeb") } (2)如果想在 阅读全文
posted @ 2021-09-18 17:23 Excel2016 阅读(1796) 评论(0) 推荐(0)
摘要:1 设置 Git 合并策略 由于 Git 默认对文本文件会进行合并,但是由于 Unity 生成的文本文件逻辑意义上并不是文本,而是二进制数据,所以我们需要让 Git 在合并时不进行文本合并。 设置自动生成的文本文件为不合并策略 .gitattributes *.anim merge=binary * 阅读全文
posted @ 2021-09-16 12:56 Excel2016 阅读(609) 评论(0) 推荐(0)
摘要:摄像机跟随目标,鼠标滑轮可以调整距离 InputController.cs using System.Collections; using System.Collections.Generic; using UnityEngine; public class InputController : Mo 阅读全文
posted @ 2021-09-14 15:22 Excel2016 阅读(302) 评论(0) 推荐(0)
摘要:1.在人模这里点提取纹理Materials,分别提取Textures和Materials,然后新建一个文件夹保存,会弹出一个窗口,点Fix的那个,然后就有了 2.把Location改为 Use External Materials(Legacy),可以把Naming 改为Model Name + M 阅读全文
posted @ 2021-09-14 00:40 Excel2016 阅读(2776) 评论(0) 推荐(0)