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