Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Editor/AssetBundleModel/ABModelAssetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,19 @@ internal string fullAssetName
m_AssetName = value;
m_DisplayName = System.IO.Path.GetFileNameWithoutExtension(m_AssetName);

//TODO - maybe there's a way to ask the AssetDatabase for this size info.
System.IO.FileInfo fileInfo = new System.IO.FileInfo(m_AssetName);
if (fileInfo.Exists)
fileSize = fileInfo.Length;
{
Object obj = AssetDatabase.LoadMainAssetAtPath(m_AssetName);
fileSize = UnityEngine.Profiling.Profiler.GetRuntimeMemorySizeLong(obj);
// The above isn't supported for all asset types:
if (fileSize == 0)
fileSize = fileInfo.Length;
}
else
{
fileSize = 0;
}
}
}
internal string displayName
Expand Down