mirror of
https://github.com/yasirkula/UnityAssetUsageDetector.git
synced 2026-11-21 15:32:38 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 133b8b1227 | |||
| 1db9dbf9b0 |
@@ -51,10 +51,35 @@ namespace AssetUsageDetectorNamespace
|
|||||||
if( fileSizes == null || fileSizes.Length != dependencies.Length )
|
if( fileSizes == null || fileSizes.Length != dependencies.Length )
|
||||||
fileSizes = new long[dependencies.Length];
|
fileSizes = new long[dependencies.Length];
|
||||||
|
|
||||||
for( int i = 0; i < dependencies.Length; i++ )
|
int length = dependencies.Length;
|
||||||
|
for( int i = 0; i < length; i++ )
|
||||||
{
|
{
|
||||||
FileInfo assetFile = new FileInfo( dependencies[i] );
|
if( !string.IsNullOrEmpty( dependencies[i] ) )
|
||||||
fileSizes[i] = assetFile.Exists ? assetFile.Length : 0L;
|
{
|
||||||
|
FileInfo assetFile = new FileInfo( dependencies[i] );
|
||||||
|
fileSizes[i] = assetFile.Exists ? assetFile.Length : 0L;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This dependency is empty which causes issues when passed to FileInfo constructor
|
||||||
|
// Find a non-empty dependency and move it to this index
|
||||||
|
for( int j = length - 1; j > i; j--, length-- )
|
||||||
|
{
|
||||||
|
if( !string.IsNullOrEmpty( dependencies[j] ) )
|
||||||
|
{
|
||||||
|
dependencies[i--] = dependencies[j];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( length != fileSizes.Length )
|
||||||
|
{
|
||||||
|
Array.Resize( ref dependencies, length );
|
||||||
|
Array.Resize( ref fileSizes, length );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,11 @@ namespace AssetUsageDetectorNamespace
|
|||||||
m_boxGUIStyle.focused.textColor = textColor;
|
m_boxGUIStyle.focused.textColor = textColor;
|
||||||
m_boxGUIStyle.active.textColor = textColor;
|
m_boxGUIStyle.active.textColor = textColor;
|
||||||
|
|
||||||
|
#if !UNITY_2019_1_OR_NEWER || UNITY_2019_3_OR_NEWER
|
||||||
|
// On 2019.1 and 2019.2 versions, GUI.skin.button.fontSize returns 0 on some devices
|
||||||
|
// https://forum.unity.com/threads/asset-usage-detector-find-references-to-an-asset-object-open-source.408134/page-3#post-7285954
|
||||||
m_boxGUIStyle.fontSize = ( m_boxGUIStyle.fontSize + GUI.skin.button.fontSize ) / 2;
|
m_boxGUIStyle.fontSize = ( m_boxGUIStyle.fontSize + GUI.skin.button.fontSize ) / 2;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_boxGUIStyle;
|
return m_boxGUIStyle;
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "com.yasirkula.assetusagedetector",
|
"name": "com.yasirkula.assetusagedetector",
|
||||||
"displayName": "Asset Usage Detector",
|
"displayName": "Asset Usage Detector",
|
||||||
"version": "1.9.4",
|
"version": "1.9.6",
|
||||||
"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",
|
||||||
|
|||||||
Reference in New Issue
Block a user