Compare commits

..

3 Commits

6 changed files with 28 additions and 4 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
**Discord:** https://discord.gg/UJJt549AaV **Discord:** https://discord.gg/UJJt549AaV
**[Support the Developer ☕](https://yasirkula.itch.io/unity3d)** **[GitHub Sponsors ☕](https://github.com/sponsors/yasirkula)**
## ABOUT ## ABOUT
@@ -96,6 +96,13 @@ namespace AssetUsageDetectorNamespace
#endregion #endregion
#region Other Settings #region Other Settings
private static bool? m_showRootAssetName = null;
public static bool ShowRootAssetName
{
get { if( m_showRootAssetName == null ) m_showRootAssetName = EditorPrefs.GetBool( "AUD_ShowRootAssetName", false ); return m_showRootAssetName.Value; }
set { if( m_showRootAssetName == value ) return; m_showRootAssetName = value; EditorPrefs.SetBool( "AUD_ShowRootAssetName", value ); }
}
private static bool? m_pingClickedObjects = null; private static bool? m_pingClickedObjects = null;
public static bool PingClickedObjects public static bool PingClickedObjects
{ {
@@ -179,7 +186,9 @@ namespace AssetUsageDetectorNamespace
EditorGUI.BeginChangeCheck(); EditorGUI.BeginChangeCheck();
SettingsHeaderColor = ColorField( "Settings Header Color", SettingsHeaderColor, Color.cyan ); EditorGUIUtility.labelWidth += 140f;
ShowRootAssetName = EditorGUILayout.Toggle( "Show Root Asset's Name For Sub-Assets (Requires Refresh)", ShowRootAssetName );
EditorGUIUtility.labelWidth -= 140f;
EditorGUILayout.Space(); EditorGUILayout.Space();
@@ -202,6 +211,7 @@ namespace AssetUsageDetectorNamespace
EditorGUILayout.Space(); EditorGUILayout.Space();
SettingsHeaderColor = ColorField( "Settings Header Color", SettingsHeaderColor, Color.cyan );
SearchResultGroupHeaderColor = ColorField( "Group Header Color", SearchResultGroupHeaderColor, Color.cyan ); SearchResultGroupHeaderColor = ColorField( "Group Header Color", SearchResultGroupHeaderColor, Color.cyan );
RootRowsBackgroundColor = ColorField( "Root Rows Background Color", RootRowsBackgroundColor, EditorGUIUtility.isProSkin ? new Color( 0f, 1f, 1f, 0.15f ) : new Color( 0f, 1f, 1f, 0.25f ) ); RootRowsBackgroundColor = ColorField( "Root Rows Background Color", RootRowsBackgroundColor, EditorGUIUtility.isProSkin ? new Color( 0f, 1f, 1f, 0.15f ) : new Color( 0f, 1f, 1f, 0.25f ) );
RootRowsBorderColor = ColorField( "Root Rows Border Color", RootRowsBorderColor, EditorGUIUtility.isProSkin ? new Color( 0.15f, 0.15f, 0.15f, 1f ) : new Color( 0.375f, 0.375f, 0.375f, 1f ) ); RootRowsBorderColor = ColorField( "Root Rows Border Color", RootRowsBorderColor, EditorGUIUtility.isProSkin ? new Color( 0.15f, 0.15f, 0.15f, 1f ) : new Color( 0.375f, 0.375f, 0.375f, 1f ) );
@@ -1,6 +1,7 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Text; using System.Text;
using UnityEditor; using UnityEditor;
using UnityEditor.IMGUI.Controls; using UnityEditor.IMGUI.Controls;
@@ -1221,6 +1222,13 @@ namespace AssetUsageDetectorNamespace
{ {
instanceId = unityObject.GetInstanceID(); instanceId = unityObject.GetInstanceID();
Label = unityObject.name + " (" + unityObject.GetType().Name + ")"; Label = unityObject.name + " (" + unityObject.GetType().Name + ")";
if( AssetUsageDetectorSettings.ShowRootAssetName && unityObject.IsAsset() && !AssetDatabase.IsMainAsset( unityObject ) )
{
string mainAssetName = Path.GetFileNameWithoutExtension( AssetDatabase.GetAssetPath( unityObject ) );
if( unityObject.name != mainAssetName )
Label += " <" + mainAssetName + ">";
}
} }
else if( nodeObject != null ) else if( nodeObject != null )
{ {
@@ -177,6 +177,12 @@ namespace AssetUsageDetectorNamespace
selection = objTR.gameObject; selection = objTR.gameObject;
#endif #endif
} }
else if( prefabAssetType == PrefabAssetType.Model )
{
objTR = ( (GameObject) obj ).transform;
while( objTR.parent != null && objTR.parent.parent != null )
objTR = objTR.parent;
}
#else #else
Transform objTR = ( (GameObject) obj ).transform; Transform objTR = ( (GameObject) obj ).transform;
while( objTR.parent != null && objTR.parent.parent != null ) while( objTR.parent != null && objTR.parent.parent != null )
+1 -1
View File
@@ -1,4 +1,4 @@
= Asset Usage Detector (v2.4.0) = = Asset Usage Detector (v2.4.1) =
Online documentation available at: https://github.com/yasirkula/UnityAssetUsageDetector Online documentation available at: https://github.com/yasirkula/UnityAssetUsageDetector
E-mail: yasirkula@gmail.com E-mail: yasirkula@gmail.com
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "com.yasirkula.assetusagedetector", "name": "com.yasirkula.assetusagedetector",
"displayName": "Asset Usage Detector", "displayName": "Asset Usage Detector",
"version": "2.4.0", "version": "2.4.1",
"documentationUrl": "https://github.com/yasirkula/UnityAssetUsageDetector", "documentationUrl": "https://github.com/yasirkula/UnityAssetUsageDetector",
"changelogUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/releases", "changelogUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/releases",
"licensesUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/blob/master/LICENSE.txt", "licensesUrl": "https://github.com/yasirkula/UnityAssetUsageDetector/blob/master/LICENSE.txt",