110 lines
5.0 KiB
C#
110 lines
5.0 KiB
C#
|
using Axibug.Editor;
|
|||
|
using Axibug.Resources;
|
|||
|
using Game;
|
|||
|
using UnityEditor;
|
|||
|
|
|||
|
namespace Game.Editor
|
|||
|
{
|
|||
|
[CustomEditor(typeof(ResourcesComponent))]
|
|||
|
public sealed class ResourceComponentInspector : GameInspector
|
|||
|
{
|
|||
|
private bool bAssets = true;
|
|||
|
private bool bPrefabs = true;
|
|||
|
private bool bAssetBundles = true;
|
|||
|
|
|||
|
public override void OnInspectorGUI()
|
|||
|
{
|
|||
|
base.OnInspectorGUI();
|
|||
|
|
|||
|
serializedObject.Update();
|
|||
|
|
|||
|
ResourcesComponent t = (ResourcesComponent)target;
|
|||
|
|
|||
|
if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
|
|||
|
{
|
|||
|
bAssets = EditorGUILayout.Foldout(bAssets, "Assets");
|
|||
|
if (bAssets)
|
|||
|
{
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//asset
|
|||
|
EditorGUILayout.LabelField("Cache Assets");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>asset
|
|||
|
EditorGUILayout.LabelField("Count", AssetManager.getCacheAssetsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetManager.getCacheAssetsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Loading Assets");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD>ڼ<EFBFBD><DABC>ص<EFBFBD>asset
|
|||
|
EditorGUILayout.LabelField("Count", AssetManager.getLoadingAssetsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetManager.getLoadingAssetsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Unloads Assets");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//ж<>ص<EFBFBD>asset
|
|||
|
EditorGUILayout.LabelField("Count", AssetManager.getUnloadsAssetsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetManager.getUnloadsAssetsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
}
|
|||
|
bPrefabs = EditorGUILayout.Foldout(bPrefabs, "Prefabs");
|
|||
|
if (bPrefabs)
|
|||
|
{
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
EditorGUILayout.LabelField("Cache Prefabs");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Prefab
|
|||
|
EditorGUILayout.LabelField("Count", PrefabManager.getCachePrefabsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, PrefabManager.getCachePrefabsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Loading Prefabs");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD>ڼ<EFBFBD><DABC>ص<EFBFBD>Prefab
|
|||
|
EditorGUILayout.LabelField("Count", PrefabManager.getLoadingsPrefabsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, PrefabManager.getLoadingsPrefabsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Instacnes Assets");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Prefab
|
|||
|
EditorGUILayout.LabelField("Count", PrefabManager.getInstacnesPrefabsCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, PrefabManager.getInstacnesPrefabsNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
}
|
|||
|
bAssetBundles = EditorGUILayout.Foldout(bAssetBundles, "AssetBundles");
|
|||
|
if (bAssetBundles)
|
|||
|
{
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
EditorGUILayout.LabelField("Cache AssetBundles");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AssetBundle
|
|||
|
EditorGUILayout.LabelField("Count", AssetBundleManager.getCacheBundlesCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetBundleManager.getCacheBundlesNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Loading AssetBundles");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//<2F><><EFBFBD>ڼ<EFBFBD><DABC>ص<EFBFBD>AssetBundle
|
|||
|
EditorGUILayout.LabelField("Count", AssetBundleManager.getLoadingBundlesCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetBundleManager.getLoadingBundlesNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUILayout.LabelField("Waits AssetBundles");
|
|||
|
EditorGUI.indentLevel++;
|
|||
|
//ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AssetBundle
|
|||
|
EditorGUILayout.LabelField("Count", AssetBundleManager.getWaitsBundlesCount.ToString());
|
|||
|
EditorGUILayout.Popup("Names", 0, AssetBundleManager.getWaitsBundlesNames);
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
EditorGUI.indentLevel--;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
protected override void OnCompileComplete()
|
|||
|
{
|
|||
|
base.OnCompileComplete();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|