private static void BeginFindReference() { if (_target == null) { return; } switch (_mode) { case ShowMode.FolderMode: _referenceList = AssetDatabase.GetDependencies(AssetDatabase.GetAssetPath(_target), recursive); _refFolderItem = new RefFolderItem(); for (int i = 0; i < _referenceList.Length; i++) { _refFolderItem.AddRefItem(_referenceList[i]); } break; case ShowMode.ReferenceMode: _refItem = new RefItem(); _refItem.InitRef(_target); break; } }
public void InitRef(Object o) { _object = o; _path = AssetDatabase.GetAssetPath(o); //计算硬盘占用大小 FileInfo info = new FileInfo(_path); if (info.Exists) { float size = info.Length; if (size < 1024) { _size = size.ToString() + "B"; } else if (size < 1024 * 1024) { _size = System.Math.Round((size / 1024), 2).ToString() + "KB"; } else { _size = System.Math.Round((size / 1024 / 1024), 2).ToString() + "M"; } } string[] paths = AssetDatabase.GetDependencies(_path, false); for (int i = 0; i < paths.Length; i++) { RefItem item = new RefItem(); item.InitRef(AssetDatabase.LoadAssetAtPath(paths[i], typeof(Object))); _refList.Add(item); } }
private void BeginFindReference() { if (_target == null) { return; } _refItem = new RefItem(); _refItem.InitRef(AssetDatabase.GetAssetPath(_target)); }
public void InitRef(string path) { _path = path; string[] paths = AssetDatabase.GetDependencies(_path, false); for (int i = 0; i < paths.Length; i++) { RefItem item = new RefItem(); item.InitRef(paths[i]); _refList.Add(item); } }
public void InitRef(Object o) { _object = o; _path = AssetDatabase.GetAssetPath(o); string[] paths = AssetDatabase.GetDependencies(_path, false); for (int i = 0; i < paths.Length; i++) { RefItem item = new RefItem(); item.InitRef(AssetDatabase.LoadAssetAtPath(paths[i], typeof(Object))); _refList.Add(item); } }