Unity动态加载resource(纹理,材质...) & 资源包 & 热更新
1.Unity Resources dynamic Loading
-创建一个叫"Resources"的文件夹一个字母都不许错,之后就可以调用resource.load()
-//Resources load(path) path不允许添加file extention
2. // 跨场景查找获取物体
https://blog.csdn.net/qq_39108767/article/details/85113473
3.//相机组件
1 using UnityEngine; 2 using System.Collections; 3 4 public class ExampleScript : MonoBehaviour { 5 public Camera firstPersonCamera; 6 public Camera overheadCamera; 7 8 public void ShowOverheadView() { 9 firstPersonCamera.enabled = false; 10 overheadCamera.enabled = true; 11 } 12 13 public void ShowFirstPersonView() { 14 firstPersonCamera.enabled = true; 15 overheadCamera.enabled = false; 16 } 17 }
4.Unity 中obj.ToString() 后每个obj后面都带有(Unity.Engine). 不能用endWith操作.
5. https://www.arena-sayajigunj.com/difference-between-materials-and-textures/ 材质与纹理不同的比较
6. https://blog.csdn.net/JianShengShuaiest/article/details/104552948 //获得Scene 场景的相机坐标
Asset Bundle
// 绝对路径
Load from local ---> AssetBundle ab = AssetBundle.LoadFromFile("D:/AssetBundles/ab");
//获得当前路径
C# https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.getcurrentdirectory?view=net-6.0
https://stackoverflow.com/questions/703281/getting-path-relative-to-the-current-working-directory
//打包
// Editor 专用文件夹 与 Reference文件夹有异曲同工之妙
Directory.CreatDirectory -> BuildPipeline.BuildAssetBundles(dir, BuildAssetBundleOptions.None, BuildTarget.[platform])
//Load & Use AssetBundle
AssetBundle ab = AssetBundle.LoadFromFile("[Path]")
ab.LoadAsset<GameObject>("object name")
// Load From internet
https://blog.csdn.net/u014361280/article/details/112365983
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了