您现在的位置是:Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款 >
01 youtube playlist editor utility(EditorUtility.DisplayDialog unity3d中這個要怎么用)
Instagram刷粉絲, Ins買粉絲自助下單平台, Ins買贊網站可微信支付寶付款2024-07-09 02:53:46【】3人已围观
简介EditorUtility.DisplayDialogunity3d中這個要怎么用這個是一個Editor類,在需要拓展編輯的時候使用,發布游戲的時候其不會被編譯。通俗點:其不能在派生自MonoBeha
EditorUtility.DisplayDialog unity3d中這個要怎么用
這個是一個Editor類,在需要拓展編輯的時候使用,發布游戲的時候其不會被編譯。通俗點:其不能在派生自MonoBehaviour類中使用,它是用來寫插件的,游戲程序中不能使用
要使用此類,如下幾點缺一不可
1 添加命名空間 using UnityEditor ;
2 此類要放在名為Editor的文件中 (Editor文件夾個數不限)
(具體可以搜索幫助文檔)
如何在 Unity 中獲取某個對象的依賴關系
在 Unity 中目前我發現了獲取依賴關系的兩個 API 接口,分別是:
EditorUtility.CollectDependencies
AssetDatabase.GetDependencies
其中 AssetDatabase.GetDependencies 獲取到的結果就是上面演示的那樣,是大粒度的依賴關系。而 EditorUtility.CollectDependencies 獲取到的是小粒度的依賴關系,所依賴的組件和 Shader 等都會列出來,非常的仔細。
C#
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace PT.Find
{
[ExecuteInEditMode]
public static class Find
{
[MenuItem("Find/What objects in scene use this?", false, 20)]
public static void SelectSceneUsesOfAsset()
{
Object selectedObject = Selection.activeObject;
if (selectedObject == null)
{
return;
}
Object[] roots = new Object[]{ selectedObject };
var objs = EditorUtility.CollectDependencies(roots);
string path = AssetDatabase.GetAssetPath(selectedObject);
var objs2 = AssetDatabase.GetDependencies(path);
foreach (var obj in objs)
{
Debug.Log(obj.GetType().Name);
}
}
}
}
#endif
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace PT.Find
{
[ExecuteInEditMode]
public static class Find
{
[MenuItem("Find/What objects in scene use this?", false, 20)]
public static void SelectSceneUsesOfAsset()
{
Object selectedObject = Selection.activeObject;
if (selectedObject == null)
{
return;
}
Object[] roots = new Object[]{ selectedObject };
var objs = EditorUtility.CollectDependencies(roots);
string path = AssetDatabase.GetAssetPath(selectedObject);
var objs2 = AssetDatabase.GetDependencies(path);
foreach (var objin objs)
{
Debug.Log(obj.GetType().Name);
}
}
}
}
#endif
不得不說,Unity Editor 提供的默認的依賴查找的功能好弱,包括反向依賴關系,引用關系丟失等功能。或許我們可以利用這些接口自己做一個好用點的依賴關系查找插件。
EditorUtility.DisplayDialog unity3d中這個要怎么用
這個是一個Editor類,在需要拓展編輯的時候使用,發布游戲的時候其不會被編譯。通俗點:其不能在派生自MonoBehaviour類中使用,它是用來寫插件的,游戲程序中不能使用
要使用此類,如下幾點缺一不可
1 添加命名空間 using UnityEditor ;
2 此類要放在名為Editor的文件中 (Editor文件夾個數不限)
(具體可以搜索幫助文檔)
如何在 Unity 中獲取某個對象的依賴關系
在 Unity 中目前我發現了獲取依賴關系的兩個 API 接口,分別是:
EditorUtility.CollectDependencies
AssetDatabase.GetDependencies
其中 AssetDatabase.GetDependencies 獲取到的結果就是上面演示的那樣,是大粒度的依賴關系。而 EditorUtility.CollectDependencies 獲取到的是小粒度的依賴關系,所依賴的組件和 Shader 等都會列出來,非常的仔細。
C#
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace PT.Find
{
[ExecuteInEditMode]
public static class Find
{
[MenuItem("Find/What objects in scene use this?", false, 20)]
public static void SelectSceneUsesOfAsset()
{
Object selectedObject = Selection.activeObject;
if (selectedObject == null)
{
return;
}
Object[] roots = new Object[]{ selectedObject };
var objs = EditorUtility.CollectDependencies(roots);
string path = AssetDatabase.GetAssetPath(selectedObject);
var objs2 = AssetDatabase.GetDependencies(path);
foreach (var obj in objs)
{
Debug.Log(obj.GetType().Name);
}
}
}
}
#endif
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
namespace PT.Find
{
[ExecuteInEditMode]
public static class Find
{
[MenuItem("Find/What objects in scene use this?", false, 20)]
public static void SelectSceneUsesOfAsset()
{
Object selectedObject = Selection.activeObject;
if (selectedObject == null)
{
return;
}
Object[] roots = new Object[]{ selectedObject };
var objs = EditorUtility.CollectDependencies(roots);
string path = AssetDatabase.GetAssetPath(selectedObject);
var objs2 = AssetDatabase.GetDependencies(path);
foreach (var objin objs)
{
Debug.Log(obj.GetType().Name);
}
}
}
}
#endif
不得不說,Unity Editor 提供的默認的依賴查找的功能好弱,包括反向依賴關系,引用關系丟失等功能。或許我們可以利用這些接口自己做一個好用點的依賴關系查找插件。
很赞哦!(646)
相关文章
- 02 山東春考國際貿易專業招生數量(哪些學校招收春季高考學生)
- 02 山東大學海外優青待遇(推薦去河北上大學嗎?)
- 01 訂閱號登錄方法二維碼解析api(訂閱號怎么生成二維碼)
- 02 小飛幫粉絲買手機(新人反推案《天天酷跑》)
- 02 山東應急管理買粉絲買粉絲二維碼(山東應急管理買粉絲買粉絲怎么關注)
- 02 山東原油進出口貿易公司聯系人電話(中國石油倒賣原油給山東濱化對濱化股價有影響嗎)
- 02 山東外事職業大學國際經濟與貿易(山東外事職業大學濟南校區有什么專業?)
- 02 山東中洋國際貿易有限公司(福建在澳門最有錢是誰首富是誰)
- 02 山東專升本國際經濟與貿易專業(山東省專升本專業 我現在大二,想專升本,我現在學的是國際經濟與貿易,我想考日語專業,可以嗎)
- 02 山東教育信息化買粉絲買粉絲(怎樣登錄"江蘇教育信息化″買粉絲買粉絲)
热门文章
站长推荐
01 訂閱號登錄買粉絲是否有效需要(如何關閉買粉絲買粉絲)
02 山東交警買粉絲直播間怎么進入(浙江考生林歡提前20分鐘交卷,笑稱“太簡單”,到底考了幾分?)
01 訂閱號登錄平臺登錄浙江稅務網站(如何關閉河北稅務訂閱號消息)
01 訂閱號登錄方法模擬登錄并爬(買粉絲營銷怎么做)
02 山東新華醫藥貿易有限公司怎么樣(新浦好玩的地方)
02 屬于內陸交貨的貿易術語(貿易條款中有ICD嗎?ICD是什么?)
02 屬于內向型經濟發展戰略的對外貿易政策是(誰可以給我 東財10春學期《中國對外貿易》在線作業一(隨機) 的答案,分就是你的,不一定100,60后就行)
02 山東中匯盈國際貿易有限公司(香港有股票多少只?)