当前位置:网站首页>Unity gets the resources that a file depends on
Unity gets the resources that a file depends on
2022-04-23 07:51:00 【[struggling]】
Unity Get the resource that a file depends on
stay Assets Select a file under the folder , Get file path , According to the selected file path , Get all the resources that the file depends on
stay Editor Create under folder AssetDepend.cs
using UnityEngine;
using UnityEditor;
using System.IO;
public class AssetDepend
{
[MenuItem("Assets/AssetDepend")]
static void Depend()
{
string[] guids = Selection.assetGUIDs;
foreach(var guid in guids)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guid);
// Determine whether the path is a file
if (File.Exists(assetPath))
{
Dependencies(assetPath);
}
}
}
static void Dependencies(string assetPath)
{
// Iteration
bool recursive = false;
// Get the resource path that the file depends on
string[] dependencies = AssetDatabase.GetDependencies(assetPath, recursive);
foreach(var path in dependencies)
{
Debug.Log(path);
}
}
}
版权声明
本文为[[struggling]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230627004646.html
边栏推荐
- The page displays the current time in real time
- 庄懂的TA笔记(七)<Lambert+Phong+Shadow+3EvColor+AO>
- Xamarin版的C# SVG路径解析器
- Simple random roll call lottery (written under JS)
- Configure NPM
- 将单行文字自动适应到目标矩形框内
- Mongodb 启动警告信息处理
- 对复杂字典Dictionary<T1,T2>排序问题
- Unity ugui determines the solution of clicking on the UI and 3D objects
- Shapley Explanation Networks
猜你喜欢

移动端布局(3D转换、动画)

命令行参数传递库argparse的使用

Rethink | open the girl heart mode of station B and explore the design and implementation of APP skin changing mechanism

Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments

Install and configure Taobao image NPM (cnpm)

int a = 1存放在哪
![MySQL8. 0 installation / uninstallation tutorial [window10 version]](/img/9c/1acf153b410f0d2eb6a23dcdbabb88.png)
MySQL8. 0 installation / uninstallation tutorial [window10 version]

js之预解析

MySQL in window10 version does not work after setting remote access permission

King glory - unity learning journey
随机推荐
Simple random roll call lottery (written under JS)
C # use laida criterion (3) σ Criteria) reject abnormal data (.Net reject singular values in a group of data)
c#读取INI文件和向ini文件写入数据
基于NLP的软件安全研究(一)
取得所有点列表中的最大值GetMaxPoint
NodeJS(六) 子进程操作
js之DOM学习获取元素
Double sided shader
自己封装unity的Debug函数
js中对象的三种创建方式
NodeJS(四) 字符读取
面经的总结
js之函数的两种声明方式
Unity screen adaptation
RGB颜色转HEX进制与单位换算
js之节点操作,为什么要学习节点操作
Nodejs (I) event driven programming
IDEA快捷键
移动Web(字体图标、平面转换、颜色渐变)
js之预解析