UnityEditorã®AssetBundleãåå¾ãã
ã¢ã¤ã³ã³ã¨ããããªã¢ã«ã¨ããã¼ã£ã±ã
EditorGUIUtility.GetEditorAssetBundleã§åå¾ã§ãã
å®ã¯EditorGUIUtility.Loadã¯ãã®AssetBundleãããã¼ããã¦ããããã
使ãæã¯ãããªæã
Texture2D icon = EditorGUIUtility.Load ("Icons/Generated/PrefabNormal Icon.asset") as Texture2D;
using UnityEngine; using System.Reflection; using UnityEditor; public class EditorAssetBundle : EditorWindow { Object[] objs; [MenuItem("Window/EditorAssetBundle")] static void Do () { GetWindow<EditorAssetBundle> (); } void OnEnable () { MethodInfo info = typeof(EditorGUIUtility).GetMethod ("GetEditorAssetBundle", BindingFlags.Static | BindingFlags.NonPublic); AssetBundle bundle = info.Invoke (null, new object[0]) as AssetBundle; objs = bundle.LoadAll (); } void OnDisable () { objs = null; EditorUtility.UnloadUnusedAssets (); } Vector2 pos; void OnGUI () { pos = EditorGUILayout.BeginScrollView (pos); foreach (Object texture in objs) { GUILayout.Label (EditorGUIUtility.ObjectContent (texture, texture.GetType ())); } EditorGUILayout.EndScrollView (); } }