ReferenceFinder 学习
版本 2018.4.6f1
https://github.com/blueberryzzz/ReferenceFinder
https://blog.uwa4d.com/archives/UWALab_UnityTools.html
https://docs.unity.cn/cn/current/ScriptReference/AssetDatabase.GetAssetDependencyHash.html
AssetDatabase.GetAllAssetPaths 几乎是新项目
Assets ProjectSettings/InputManager.asset ProjectSettings/TagManager.asset ProjectSettings/ProjectSettings.asset Library/BuildPlayer.prefs ProjectSettings/AudioManager.asset ProjectSettings/TimeManager.asset ProjectSettings/DynamicsManager.asset ProjectSettings/QualitySettings.asset ProjectSettings/EditorBuildSettings.asset ProjectSettings/EditorSettings.asset ProjectSettings/NavMeshAreas.asset ProjectSettings/Physics2DSettings.asset ProjectSettings/GraphicsSettings.asset ProjectSettings/ClusterInputManager.asset ProjectSettings/UnityConnectSettings.asset ProjectSettings/PresetManager.asset ProjectSettings/VFXManager.asset Packages/com.unity.modules.unityanalytics Packages/com.unity.textmeshpro/Scripts/Editor/TMP_GlyphPropertyDrawer.cs Packages/com.unity.package-manager-ui/Editor/Resources Packages/com.unity.textmeshpro/Editor Resources/Textures/SectionHeader_Light.psd Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages/PackageBaseTests.cs Packages/com.unity.textmeshpro/Scripts/Runtime/AssemblyInfo.cs.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageOrigin.cs Packages/com.unity.textmeshpro/Editor Resources/Shaders/TMP_Properties.cginc Packages/com.unity.collab-proxy/README.md Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock/MockAddOperation.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCapLine_Light.psd Packages/com.unity.package-manager-ui/Editor/Resources/Images/Dark/error.png Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common/LoadingSpinner.cs Packages/com.unity.modules.tilemap Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SelectionCaret.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_EditorResourceManager.cs Packages/com.unity.purchasing/License.md Packages/com.unity.collab-proxy/Editor/Collab/Presenters Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Dropdown.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services Packages/com.unity.analytics/DataPrivacy/AssemblyInfo.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignBottom.psd D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Timeline/Runtime/UnityEngine.Timeline.dll Packages/com.unity.modules.vehicles Packages/com.unity.package-manager-ui/Editor/Sources/UI Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageInfo.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock/MockOperation.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCapLine.psd Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ScrollbarEventHandler.cs Packages/com.unity.modules.animation Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageAddFromUrlField.cs Packages/com.unity.modules.terrainphysics/package.json Packages/com.unity.analytics/package.json Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SubMesh_Editor.cs Packages/com.unity.collab-proxy/Editor/Collab/CollabToolbarButton.cs Packages/com.unity.modules.particlesystem Packages/com.unity.package-manager-ui/CHANGELOG.md Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignBaseLine_Light.psd D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/TestRunner/portable/nunit.framework.dll Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/IRemoveOperation.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteAssetMenu.cs Packages/com.unity.modules.video/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Text.cs Packages/com.unity.modules.physics/package.json Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmSearchOperation.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Style.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/iOS/libaudiopluginresonanceaudio.a Packages/com.unity.modules.unitywebrequesttexture/package.json Packages/com.unity.textmeshpro/Scripts/Runtime Packages/com.unity.analytics/CHANGELOG.md Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageDetails.cs Packages/com.unity.modules.unitywebrequest/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_CoroutineTween.cs Packages/com.unity.package-manager-ui/LICENSE.md Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageManagerWindow.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common/Alert.cs Packages/com.unity.purchasing/Documentation/IAP.md Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_MeshUtilities.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageManagerToolbar.uxml D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll Packages/com.unity.package-manager-ui/Editor/AssemblyInfo.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Sprite.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Android/gvr.aar D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/android_arm/libaudiopluginresonanceaudio.so Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageAssetPostprocessor.cs Packages/com.unity.collab-proxy/Editor/Collab/Views/BuildStatusButton.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/UIElementsSchema Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_InputField.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AchievementUnlockedTests.cs Packages/com.unity.collab-proxy/Editor/Collab/Presenters/CollabHistoryPresenter.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontFeaturesCommon.cs Assets/ReferenceFinder-master/ReadmeDoc/Start.png Packages/com.unity.textmeshpro/Scripts/Editor/GlyphMetricsPropertyDrawer.cs Packages/com.unity.ads/UnityEngine.Advertisements.dll Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UADSMetaData.h Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces Packages/com.unity.purchasing/Editor/UnityEditor.Purchasing.dll.mdb D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll Packages/com.unity.textmeshpro Packages/com.unity.package-manager-ui/Editor/Sources/Services/OperationFactory.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/MockOperationFactory.cs Packages/com.unity.package-manager-ui/Editor/Resources/Images/Light Packages/com.unity.collab-proxy/Editor/Collab/Views/ICollabHistoryItemFactory.cs Packages/com.unity.package-manager-ui/Tests/Editor/Common Assets/ResourceArt/Image.prefab Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_ExtensionMethods.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/IOperationFactory.cs Packages/com.unity.package-manager-ui/Tests/Editor Packages/com.unity.analytics/Tests/Runtime/DataPrivacy Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageStatusBar.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/ISearchOperation.cs Packages/com.unity.package-manager-ui/Editor/Resources/Styles/Main_Light.scss D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Android/unitygvr.aar Packages/com.unity.collab-proxy/Editor/Resources Packages/com.unity.textmeshpro/Editor Resources/Textures/SectionHeader_Dark.psd Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelFailTests.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteAssetEditor.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_StyleAssetMenu.cs Packages/com.unity.modules.jsonserialize Packages/com.unity.purchasing/README.md Packages/com.unity.modules.ui Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/CutsceneSkipTests.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/Unity.Analytics.StandardEvents.EditorTests.asmdef Packages/com.unity.modules.xr/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/ScreenVisitTests.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll Packages/com.unity.package-manager-ui/Editor/Resources/Templates Packages/com.unity.textmeshpro/Editor Resources Packages/com.unity.modules.physics2d/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontFeatureTable.cs Assets/ReferenceFinder-master/LICENSE Packages/com.unity.textmeshpro/Scripts/Editor/GlyphRectPropertyDrawer.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_FontPlugin.cs Packages/com.unity.textmeshpro/Tests/Runtime/TMP_RuntimeTests.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SubMeshUI.cs Packages/com.unity.analytics/Tests Packages/com.unity.collab-proxy/Editor/Collab/Views/HistoryProgressSpinner.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageGroup.cs Packages/com.unity.modules.ui/package.json D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Linux64/libaudiopluginresonanceaudio.so Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmOperationFactory.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCenter_Light.psd Packages/com.unity.package-manager-ui/Tests Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/PushNotificationClickTests.cs Packages/com.unity.textmeshpro/Scripts Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/ItemSpentTests.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Runtime/UnityEngine.SpatialTracking.dll Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm Assets/ResourceArt Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignMiddle.psd D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll Packages/com.unity.modules.cloth Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageStatusBar.uxml Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_EventManager.cs Packages/com.unity.textmeshpro/Scripts/Runtime/MaterialReferenceManager.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/IAPTransactionTests.cs Packages/com.unity.modules.unitywebrequest Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework Packages/com.unity.textmeshpro/Scripts/Editor/TMP_GlyphPairAdjustmentRecordPropertyDrawer.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/Alert.uxml Assets/ReferenceFinder-master/Editor Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UnityAdsExtended.h Packages/com.unity.purchasing/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/StoreItemClickTests.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageFilter.cs Packages/com.unity.purchasing/Documentation Packages/com.unity.purchasing/UnityEngine.Purchasing.dll.mdb D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll Packages/com.unity.analytics/DataPrivacy/DataPrivacy.cs Packages/com.unity.analytics/Unity.Analytics.Tracker.dll Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageItem.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/OSXIntel64/audiopluginresonanceaudio.bundle Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_UpdateRegistery.cs Packages/com.unity.collab-proxy/Editor/Collab/Views Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageCollection.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/SocialShareAcceptTests.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/PostAdActionTests.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignTop.psd Packages/com.unity.package-manager-ui/Editor/Resources/Images/Dark/loading.png Packages/com.unity.textmeshpro/Editor Resources/Textures Packages/com.unity.textmeshpro/Editor Resources/Shaders/TMP_SDF Internal SSD.shader Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelQuitTests.cs Assets/ReferenceFinder-master/Editor/ReferenceFinderWindow.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageGroup.uxml Packages/com.unity.textmeshpro/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAsset.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/FirstInteractionTests.cs Packages/com.unity.analytics/Tests/Runtime Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageSearchFilter.cs Assets/Scenes Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_MeshInfo.cs Packages/com.unity.textmeshpro/Scripts/Editor/GlyphInfoDrawer.cs Packages/com.unity.analytics/DataPrivacy/DataPrivacyButton.prefab Packages/com.unity.textmeshpro/PackageConversionData_Assets.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_CharacterInfo.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Win/audiopluginresonanceaudio.dll Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents Packages/com.unity.analytics/Tests/Editor Packages/com.unity.ads/Editor/Resources/Editor Packages/com.unity.package-manager-ui/Editor/Resources/Images/Light/loading.png Packages/com.unity.textmeshpro/Scripts/Editor/TMP_FontAsset_CreationMenu.cs Assets/ReferenceFinder-master/README.md Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelStartTests.cs Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Info.plist Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageAddFromUrlField.uxml Packages/com.unity.package-manager-ui/Editor/Resources/Images/Dark Packages/com.unity.package-manager-ui/Editor Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignFlush.psd Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock/MockListOperation.cs Packages/com.unity.package-manager-ui/Editor/Resources/Styles/Main_Dark.scss Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageList.cs Assets/ReferenceFinder-master Packages/com.unity.textmeshpro/PackageConversionData.json Packages/com.unity.modules.audio/package.json Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteCharacterPropertyDrawer.cs Packages/com.unity.collab-proxy/package.json Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/IAddOperation.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AdCompleteTests.cs Packages/com.unity.modules.imageconversion/package.json Packages/com.unity.ads/Editor/Resources/Editor/landscape.jpg Packages/com.unity.analytics/Unity.Analytics.StandardEvents.dll Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageJsonHelper.cs Packages/com.unity.modules.video Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Modules/module.modulemap Packages/com.unity.collab-proxy/Editor/Resources/Styles/CollabHistoryLight.uss Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/StoreOpenedTests.cs Packages/com.unity.textmeshpro/LICENSE.md Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_ContextMenus.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_BaseShaderGUI.cs Packages/com.unity.textmeshpro/Package Resources/TMP Examples & Extras.unitypackage Packages/com.unity.modules.vr Packages/com.unity.modules.assetbundle/package.json Packages/com.unity.modules.tilemap/package.json Packages/com.unity.textmeshpro/Scripts/Editor/Unity.TextMeshPro.Editor.asmdef Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCenter.psd Packages/com.unity.collab-proxy/Editor Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Asset.cs Packages/com.unity.package-manager-ui/Editor/Resources/Styles/_common.scss Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/UserSignupTests.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Character.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/ItemAcquiredTests.cs Packages/com.unity.collab-proxy/Editor/Collab/CollabHistoryWindow.cs Packages/com.unity.ads/UnityEngine.Advertisements.dll.mdb Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteGlyphPropertyDrawer.cs Packages/com.unity.package-manager-ui/Tests/Editor/UI Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignFlush_Light.psd Packages/com.unity.collab-proxy/DEPENDENCIES.md Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AdSkipTests.cs Packages/com.unity.collab-proxy/CHANGELOG.md Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ObjectPool.cs Assets/ReferenceFinder-master/ReadmeDoc/SingleSearch.png D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ShaderUtilities.cs Packages/com.unity.analytics/Tests/Runtime/DataPrivacy/JsonSerialization.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageManagerToolbar.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_InputFieldEditor.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageItem.uxml Packages/com.unity.purchasing/UnityEngine.Purchasing.dll Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCenterGeo_Light.psd Packages/com.unity.modules.unitywebrequestaudio/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ListPool.cs Packages/com.unity.modules.director Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_RichTextTagStack.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_EditorUtility.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteGlyph.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_ColorGradientAssetMenu.cs Packages/com.unity.ads Packages/com.unity.analytics Packages/com.unity.analytics/Unity.Analytics.Editor.dll Packages/com.unity.modules.screencapture/package.json Packages/com.unity.collab-proxy/Editor/Collab/Views/CollabHistoryDropDownItem.cs Packages/com.unity.package-manager-ui/Tests/Editor/UI/PackageManagerWindowTests.cs Packages/com.unity.package-manager-ui/Tests/Editor/Unity.PackageManagerUI.EditorTests.asmdef Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextUtilities.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_ProjectTextSettings.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/TutorialSkipTests.cs Packages/com.unity.modules.unitywebrequestaudio Packages/com.unity.modules.terrain Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAnimator.cs Packages/com.unity.package-manager-ui/package.json Packages/com.unity.package-manager-ui/Editor/Resources/Images/Light/download.png Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Input Field Icon.psd Packages/com.unity.textmeshpro/Tests/Runtime/Unity.TextMeshPro.Tests.asmdef Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_RichTextTagsCommon.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_TextAlignmentDrawer.cs Packages/com.unity.package-manager-ui/Editor/Unity.PackageManagerUI.Editor.asmdef Packages/com.unity.ads/Editor/Resources/iOS/builds Packages/com.unity.collab-proxy/Editor/Resources/Styles Packages/com.unity.textmeshpro/CHANGELOG.md Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageDetails.uxml Packages/com.unity.modules.screencapture Packages/com.unity.textmeshpro/Tests/Editor/Unity.TextMeshPro.Editor.Tests.asmdef Packages/com.unity.ads/Editor/Resources/Android Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Font Asset Icon.psd Packages/com.unity.collab-proxy/Editor/Collab Packages/com.unity.package-manager-ui/Third Party Notices.md Packages/com.unity.textmeshpro/Scripts/Editor/TMP_DropdownEditor.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageError.cs Packages/com.unity.package-manager-ui/Editor/Sources/External/SemVersionExtension.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignTop_Light.psd Packages/com.unity.ads/Editor/Resources/iOS Packages/com.unity.package-manager-ui/Editor/Sources/Services Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages/PackageSearchTests.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_BaseEditorPanel.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TextContainer.cs Packages/com.unity.textmeshpro/Tests/Editor/TMP_EditorTests.cs Packages/com.unity.ads/Editor Packages/com.unity.package-manager-ui/Tests/Editor/Common/PackageSets.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignLeft_Light.psd Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignMidLine.psd Assets/ResourceArt/Activity_bg_mask.png Packages/com.unity.modules.xr Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_TexturePostProcessor.cs Packages/com.unity.collab-proxy/Editor/Resources/Styles/CollabHistoryCommon.uss Packages/com.unity.collab-proxy/Editor/Unity.CollabProxy.Editor.asmdef Packages/com.unity.modules.imgui/package.json Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_FontAssetCreatorWindow.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/TutorialCompleteTests.cs Packages/com.unity.modules.unitywebrequestassetbundle/package.json Packages/com.unity.collab-proxy/Tests/Editor/HistoryTests.cs Packages/com.unity.package-manager-ui/Editor/Sources/External Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontAssetUtilities.cs Packages/com.unity.purchasing/Editor/UnityEditor.Purchasing.dll Packages/com.unity.analytics/License.md Packages/com.unity.collab-proxy/Tests/Editor Packages/com.unity.purchasing D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UADSJsonStorage.h Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_DefaultControls.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_MeshRendererEditor.cs Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Modules Packages/com.unity.textmeshpro/Scripts/Editor/TMP_BitmapShaderGUI.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/IBaseOperation.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_StyleSheetEditor.cs Packages/com.unity.analytics/Editor/AnalyticsEventTracker icon.png Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignMiddle_Light.psd Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/UnityAds Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignMidline_Light.psd Packages/com.unity.modules.wind Packages/com.unity.analytics/DataPrivacy/DataPrivacyIcon.png Packages/com.unity.analytics/Tests/Runtime/DataPrivacy/Unity.Analytics.DataPrivacy.Tests.asmdef Packages/com.unity.modules.unitywebrequestwww Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontAssetCommon.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common/UIUtils.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignJustified_Light.psd Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_PackageResourceImporter.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageManagerExtensions.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelSkipTests.cs Packages/com.unity.collab-proxy/LICENSE.md Packages/com.unity.modules.ai/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_FontAsset.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_UiEditorPanel.cs Packages/com.unity.ads/License.md Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_Settings.cs Packages/com.unity.collab-proxy/Editor/Resources/Styles/CollabHistoryDark.uss Packages/com.unity.package-manager-ui/Editor/Sources/External/SemVersion.cs Packages/com.unity.modules.vehicles/package.json Packages/com.unity.textmeshpro/Tests/Runtime Packages/com.unity.purchasing/CHANGELOG.md Packages/com.unity.package-manager-ui/README.md Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Dropdown Icon.psd Packages/com.unity.collab-proxy/Editor/Collab/Views/CollabHistoryRevisionLine.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/TutorialStartTests.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_Private.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock/MockRemoveOperation.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AnalyticsEventTests.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignRight.psd Packages/com.unity.package-manager-ui/Editor/Sources Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/PushNotificationEnableTests.cs Packages/com.unity.collab-proxy/Editor/AssemblyInfo.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/UIElementsSchema/UnityEditor.PackageManager.UI.xsd D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages/PackageTests.cs Packages/com.unity.analytics/Unity.Analytics.Editor.dll.mdb Packages/com.unity.package-manager-ui/Tests/Editor/UI/PackageDetailsTests.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageState.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/GameOverTests.cs Packages/com.unity.textmeshpro/Tests/Editor D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll Packages/com.unity.package-manager-ui/Tests/Editor/Common/UITests.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignCenterGeo.psd Packages/com.unity.modules.physics2d Packages/com.unity.ads/Editor/UnityEditor.Advertisements.dll.mdb Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmAddOperation.cs Packages/com.unity.modules.umbra/package.json Packages/com.unity.modules.particlesystem/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMPro_UGUI_Private.cs Packages/com.unity.collab-proxy Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/TutorialStepTests.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageGroupOrigins.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Runtime/UnityEngine.GoogleAudioSpatializer.dll Packages/com.unity.package-manager-ui/Editor/Resources/Templates/UIElementsSchema/UnityEditor.Experimental.UIElements.xsd Packages/com.unity.package-manager-ui/Editor/Resources/Styles/Main_Light.uss Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignRight_Light.psd Packages/com.unity.package-manager-ui/Editor/Resources/Templates/UIElementsSchema/UIElements.xsd D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/android_arm64/libaudiopluginresonanceaudio.so Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageListExtensions.cs Packages/com.unity.collab-proxy/Editor/Collab/Views/StatusView.cs Packages/com.unity.collab-proxy/Editor/Collab/Views/CollabHistoryDropDown.cs Packages/com.unity.modules.imgui Packages/com.unity.modules.uielements Packages/com.unity.modules.animation/package.json Packages/com.unity.modules.ai Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelCompleteTests.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll Packages/com.unity.collab-proxy/Editor/Collab/Views/PagedListView.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages/PackageInfoTests.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignBaseLine.psd Assets/ReferenceFinder-master/ReadmeDoc Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignBottom_Light.psd Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextParsingUtilities.cs Packages/com.unity.modules.audio Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_UpdateManager.cs Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock/MockSearchOperation.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Common/Resources.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/UIElementsSchema/UnityEngine.Experimental.UIElements.xsd Packages/com.unity.package-manager-ui/Editor/Resources/Styles/Main_Dark.uss Packages/com.unity.textmeshpro/Scripts/Runtime/TextMeshProUGUI.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SettingsEditor.cs Packages/com.unity.textmeshpro/Editor Resources/Gizmos Packages/com.unity.textmeshpro/Scripts/Editor/DropdownOptionListDrawer.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextElement_Legacy.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Interfaces/IListOperation.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_TextContainerEditor.cs Packages/com.unity.collab-proxy/Editor/Collab/CollabAnalytics.cs Packages/com.unity.analytics/DataPrivacy/DataPrivacyButton.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Common/OperationSignal.cs Assets/Scenes/SampleScene.unity Packages/com.unity.ads/Editor/Resources/Android/builds/unity-ads.aar D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Win64/audiopluginresonanceaudio.dll Packages/com.unity.ads/CHANGELOG.md Packages/com.unity.textmeshpro/Scripts/Editor/TMP_CharacterPropertyDrawer.cs Packages/com.unity.collab-proxy/Tests/Editor/Unity.CollabProxy.EditorTests.asmdef Packages/com.unity.package-manager-ui/Tests/Editor/Services/Packages/PackageCollectionTests.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmListOperation.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignLeft.psd Packages/com.unity.modules.assetbundle Packages/com.unity.textmeshpro/Package Resources/TMP Essential Resources.unitypackage Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_SortingLayerHelper.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmRemoveOperation.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageTag.cs Packages/com.unity.package-manager-ui/Tests/Editor/AssemblyInfo.cs Packages/com.unity.modules.wind/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/CutsceneStartTests.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageSearchToolbar.uxml Packages/com.unity.modules.cloth/package.json Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_MaterialManager.cs Packages/com.unity.package-manager-ui/Editor/Resources/Images/Light/error.png Packages/com.unity.modules.unitywebrequesttexture Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UnityAdsUnityDelegate.h Packages/com.unity.textmeshpro/Tests Packages/com.unity.package-manager-ui/Editor/Sources/Services/Common/ApplicationUtil.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_ResourcesLoader.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_UIStyleManager.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageSearchToolbar.cs Packages/com.unity.modules.jsonserialize/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/LevelUpTests.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/ChatMessageSentTests.cs Packages/com.unity.ads/Editor/UnityEditor.Advertisements.dll Packages/com.unity.textmeshpro/Scripts/Editor/TMP_ColorGradientEditor.cs Packages/com.unity.collab-proxy/Tests Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_InputValidator.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Upm/UpmBaseOperation.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Common D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UADSInAppPurchaseMetaData.h Packages/com.unity.package-manager-ui/Editor/Sources/Services/Common/ThreadedDelay.cs Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteAssetImporter.cs Packages/com.unity.textmeshpro/Package Resources Packages/com.unity.textmeshpro/Scripts/Editor/TMP_EditorCoroutine.cs Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Sprite Asset Icon.psd Packages/com.unity.textmeshpro/Scripts/Editor/TMP_EditorPanel.cs Packages/com.unity.package-manager-ui/Editor/Resources/Images/Dark/download.png Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages Packages/com.unity.purchasing/Editor Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UADSMediationMetaData.h Packages/com.unity.analytics/Unity.Analytics.Tracker.dll.mdb Packages/com.unity.textmeshpro/Scripts/Editor/TMP_FontAssetEditor.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteCharacter.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageList.uxml Packages/com.unity.modules.unityanalytics/package.json Packages/com.unity.modules.unitywebrequestassetbundle Packages/com.unity.ads/README.md Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_StyleSheet.cs D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll Packages/com.unity.package-manager-ui/Editor/Resources/Styles Packages/com.unity.package-manager-ui/Editor/Sources/UI/Interfaces Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/PackageInfoListExtensions.cs Packages/com.unity.textmeshpro/Scripts/Runtime/FastAction.cs Packages/com.unity.ads/Editor/Resources/Android/builds Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UADSPlayerMetaData.h Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SDFShaderGUI.cs Packages/com.unity.analytics/README.md Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SubMeshUI_Editor.cs Packages/com.unity.collab-proxy/Editor/Collab/Bootstrap.cs Packages/com.unity.collab-proxy/Editor/Collab/Views/CollabHistoryItemFactory.cs Packages/com.unity.collab-proxy/Editor/Collab/CollabToolbarWindow.cs Packages/com.unity.package-manager-ui/Editor/Sources/Services/Packages/Package.cs Packages/com.unity.modules.unitywebrequestwww/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AdOfferTests.cs Packages/com.unity.package-manager-ui/Editor/Resources/Templates/PackageManagerWindow.uxml Packages/com.unity.textmeshpro/Scripts/Editor/TMP_PackageUtilities.cs Packages/com.unity.collab-proxy/Editor/Collab/Views/CollabHistoryItem.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TextMeshPro.cs Packages/com.unity.ads/Editor/Resources Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_ColorGradient.cs Packages/com.unity.ads/package.json Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AchievementStepTests.cs Packages/com.unity.analytics/Editor Packages/com.unity.textmeshpro/Scripts/Editor Packages/com.unity.textmeshpro/Scripts/Runtime/Unity.TextMeshPro.asmdef D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageManagerPrefs.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common/VersionItem.cs Packages/com.unity.analytics/DataPrivacy/Unity.Analytics.DataPrivacy.asmdef Packages/com.unity.package-manager-ui Packages/com.unity.ads/Editor/Resources/Editor/portrait.jpg Packages/com.unity.package-manager-ui/Editor/Resources/Images Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SpriteAssetImportFormats.cs Packages/com.unity.modules.terrainphysics Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/AdStartTests.cs Packages/com.unity.modules.imageconversion Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextElement.cs Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/GameStartTests.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_SubMesh.cs Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SerializedPropertyHolder.cs Assets/ReferenceFinder-master/Editor/AssetTreeView.cs Packages/com.unity.textmeshpro/Editor Resources/Gizmos/TMP - Text Component Icon.psd Packages/com.unity.analytics/Tests/Editor/Unity.Analytics.StandardEvents/SocialShareTests.cs Packages/com.unity.analytics/Unity.Analytics.StandardEvents.dll.mdb Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_TextInfo.cs Packages/com.unity.modules.terrain/package.json Packages/com.unity.ads/Editor/Resources/iOS/builds/UnityAds.framework/Headers/UnityAds.h Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_EditorShaderUtilities.cs Packages/com.unity.textmeshpro/Editor Resources/Shaders Packages/com.unity.modules.director/package.json Packages/com.unity.analytics/DataPrivacy Packages/com.unity.textmeshpro/Scripts/Editor/TMPro_CreateObjectMenu.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/Interfaces/IPackageManagerExtension.cs Packages/com.unity.textmeshpro/Scripts/Runtime/TMP_LineInfo.cs Packages/com.unity.textmeshpro/Editor Resources/Textures/btn_AlignJustified.psd Packages/com.unity.modules.umbra Packages/com.unity.package-manager-ui/Tests/Editor/Services/Mock Assets/ReferenceFinder-master/Editor/ReferenceFinderData.cs Packages/com.unity.package-manager-ui/Editor/Sources/UI/Common/PopupField.cs Packages/com.unity.modules.uielements/package.json Packages/com.unity.textmeshpro/Scripts/Editor/TMP_PostBuildProcessHandler.cs Packages/com.unity.modules.physics D:/Unity/2018.4.6f1/Editor/Data/UnityExtensions/Unity/VR/Android/libprotobuf-java-nano.jar Packages/com.unity.package-manager-ui/Editor/Sources/UI/PackageFiltering.cs Packages/com.unity.modules.vr/package.json Assets/ReferenceFinder-master/ReadmeDoc/BatchSearch.png
using UnityEngine; using UnityEditor; using UnityEditor.IMGUI.Controls; //带数据的TreeViewItem public class AssetViewItem : TreeViewItem { public ReferenceFinderData.AssetDescription data; } //资源引用树 public class AssetTreeView : TreeView { //图标宽度 const float kIconWidth = 18f; //列表高度 const float kRowHeights = 20f; public AssetViewItem assetRoot; private GUIStyle stateGUIStyle = new GUIStyle { richText = true, alignment = TextAnchor.MiddleCenter }; //列信息 enum MyColumns { Name, Path, State, } public AssetTreeView(TreeViewState state,MultiColumnHeader multicolumnHeader):base(state,multicolumnHeader) { rowHeight = kRowHeights; columnIndexForTreeFoldouts = 0; showAlternatingRowBackgrounds = true; showBorder = false; customFoldoutYOffset = (kRowHeights - EditorGUIUtility.singleLineHeight) * 0.5f; // center foldout in the row since we also center content. See RowGUI extraSpaceBeforeIconAndLabel = kIconWidth; } //响应右击事件 protected override void ContextClickedItem(int id) { SetExpanded(id, !IsExpanded(id)); } //响应双击事件 protected override void DoubleClickedItem(int id) { var item = (AssetViewItem)FindItem(id, rootItem); //在ProjectWindow中高亮双击资源 if (item != null) { var assetObject = AssetDatabase.LoadAssetAtPath(item.data.path, typeof(UnityEngine.Object)); EditorUtility.FocusProjectWindow(); Selection.activeObject = assetObject; EditorGUIUtility.PingObject(assetObject); } } //生成ColumnHeader public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState(float treeViewWidth) { var columns = new[] { //图标+名称 new MultiColumnHeaderState.Column { headerContent = new GUIContent("Name"), headerTextAlignment = TextAlignment.Center, sortedAscending = false, width = 200, minWidth = 60, autoResize = false, allowToggleVisibility = false, canSort = false }, //路径 new MultiColumnHeaderState.Column { headerContent = new GUIContent("Path"), headerTextAlignment = TextAlignment.Center, sortedAscending = false, width = 360, minWidth = 60, autoResize = false, allowToggleVisibility = false, canSort = false }, //状态 new MultiColumnHeaderState.Column { headerContent = new GUIContent("State"), headerTextAlignment = TextAlignment.Center, sortedAscending = false, width = 60, minWidth = 60, autoResize = false, allowToggleVisibility = true, canSort = false }, }; var state = new MultiColumnHeaderState(columns); return state; } protected override TreeViewItem BuildRoot() { return assetRoot; } protected override void RowGUI(RowGUIArgs args) { var item = (AssetViewItem)args.item; for(int i = 0; i < args.GetNumVisibleColumns(); ++i) { CellGUI(args.GetCellRect(i), item, (MyColumns)args.GetColumn(i), ref args); } } //绘制列表中的每项内容 void CellGUI(Rect cellRect,AssetViewItem item,MyColumns column, ref RowGUIArgs args) { CenterRectUsingSingleLineHeight(ref cellRect); switch (column) { case MyColumns.Name: { var iconRect = cellRect; iconRect.x += GetContentIndent(item); iconRect.width = kIconWidth; if (iconRect.x < cellRect.xMax) { var icon = GetIcon(item.data.path); if(icon != null) GUI.DrawTexture(iconRect, icon, ScaleMode.ScaleToFit); } args.rowRect = cellRect; base.RowGUI(args); } break; case MyColumns.Path: { GUI.Label(cellRect, item.data.path); } break; case MyColumns.State: { GUI.Label(cellRect, ReferenceFinderData.GetInfoByState(item.data.state),stateGUIStyle); } break; } } //根据资源信息获取资源图标 private Texture2D GetIcon(string path) { Object obj = AssetDatabase.LoadAssetAtPath(path, typeof(Object)); if (obj != null) { Texture2D icon = AssetPreview.GetMiniThumbnail(obj); if (icon == null) icon = AssetPreview.GetMiniTypeThumbnail(obj.GetType()); return icon; } return null; } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization.Formatters.Binary; using UnityEditor; using UnityEngine; public class ReferenceFinderData { //缓存路径 private const string CACHE_PATH = "Library/ReferenceFinderCache"; private const string CACHE_VERSION = "V1"; // 资源引用信息字典 public Dictionary<string, AssetDescription> assetDict = new Dictionary<string, AssetDescription>(); //收集资源引用信息并更新缓存 public void CollectDependenciesInfo() { try { ReadFromCache(); var allAssets = AssetDatabase.GetAllAssetPaths(); int totalCount = allAssets.Length; for (int i = 0; i < allAssets.Length; i++) { //每遍历100个Asset,更新一下进度条,同时对进度条的取消操作进行处理 if ((i % 100 == 0) && EditorUtility.DisplayCancelableProgressBar("Refresh", string.Format("Collecting {0} assets", i), (float)i / totalCount)) { EditorUtility.ClearProgressBar(); return; } if (File.Exists(allAssets[i])) ImportAsset(allAssets[i]); if (i % 2000 == 0) GC.Collect(); } //将信息写入缓存 EditorUtility.DisplayCancelableProgressBar("Refresh", "Write to cache", 1f); WriteToChache(); //生成引用数据 EditorUtility.DisplayCancelableProgressBar("Refresh", "Generating asset reference info", 1f); UpdateReferenceInfo(); EditorUtility.ClearProgressBar(); } catch(Exception e) { Debug.LogError(e); EditorUtility.ClearProgressBar(); } } //通过依赖信息更新引用信息 private void UpdateReferenceInfo() { foreach(var asset in assetDict) { foreach(var assetGuid in asset.Value.dependencies) { assetDict[assetGuid].references.Add(asset.Key); } } } // 生成并加入引用信息 // 只处理 Assets/ 文件夹中的文件 private void ImportAsset(string path) { if (!path.StartsWith("Assets/")) return; // 通过path获取guid进行储存 // path e.g. Assets/ResourceArt/ImageParent.prefab // guid 和 meta 文件中的 guid 一样 e.g. 20802022c3c1dcb40a49a7c168dd5be9 string guid = AssetDatabase.AssetPathToGUID(path); // 获取该资源的最后修改时间,用于之后的修改判断 Hash128 assetDependencyHash = AssetDatabase.GetAssetDependencyHash(path); // 如果assetDict没包含该guid或包含了修改时间不一样则需要更新 if (!assetDict.ContainsKey(guid) || assetDict[guid].assetDependencyHash != assetDependencyHash.ToString()) { //// 包含自身 e.g. //// Assets/ResourceArt/Image.prefab //// Assets/ResourceArt/Activity_bg_mask.png //// Assets/ResourceArt/ImageParent.prefab //var dependDefault = AssetDatabase.GetDependencies(path); //// 不包含自身 e.g. //// Assets/ResourceArt/Image.prefab //// Assets/ResourceArt/Activity_bg_mask.png //var dependNoRecur = AssetDatabase.GetDependencies(path, false); // 将每个资源的直接依赖资源转化为guid进行储存 var guids = AssetDatabase.GetDependencies(path, false). Select(p => AssetDatabase.AssetPathToGUID(p)). ToList(); // 生成asset依赖信息,被引用需要在所有的asset依赖信息生成完后才能生成 AssetDescription ad = new AssetDescription(); // e.g. ImageParent ad.name = Path.GetFileNameWithoutExtension(path); // e.g. Assets/ResourceArt/ImageParent.prefab ad.path = path; // e.g. 235a0c7ca1d4e6abb49b12b84c719cbd ad.assetDependencyHash = assetDependencyHash.ToString(); // e.g. // Assets/ResourceArt/Image.prefab // Assets/ResourceArt/Activity_bg_mask.png ad.dependencies = guids; if (assetDict.ContainsKey(guid)) assetDict[guid] = ad; else assetDict.Add(guid, ad); } } //读取缓存信息 public bool ReadFromCache() { assetDict.Clear(); if (!File.Exists(CACHE_PATH)) { return false; } var serializedGuid = new List<string>(); var serializedDependencyHash = new List<string>(); var serializedDenpendencies = new List<int[]>(); //反序列化数据 FileStream fs = File.OpenRead(CACHE_PATH); try { BinaryFormatter bf = new BinaryFormatter(); string cacheVersion = (string) bf.Deserialize(fs); if (cacheVersion != CACHE_VERSION) { return false; } EditorUtility.DisplayCancelableProgressBar("Import Cache", "Reading Cache", 0); serializedGuid = (List<string>) bf.Deserialize(fs); serializedDependencyHash = (List<string>) bf.Deserialize(fs); serializedDenpendencies = (List<int[]>) bf.Deserialize(fs); EditorUtility.ClearProgressBar(); } catch { //兼容旧版本序列化格式 return false; } finally { fs.Close(); } for (int i = 0; i < serializedGuid.Count; ++i) { string path = AssetDatabase.GUIDToAssetPath(serializedGuid[i]); if (!string.IsNullOrEmpty(path)) { var ad = new AssetDescription(); ad.name = Path.GetFileNameWithoutExtension(path); ad.path = path; ad.assetDependencyHash = serializedDependencyHash[i]; assetDict.Add(serializedGuid[i], ad); } } for(int i = 0; i < serializedGuid.Count; ++i) { string guid = serializedGuid[i]; if (assetDict.ContainsKey(guid)) { var guids = serializedDenpendencies[i]. Select(index => serializedGuid[index]). Where(g => assetDict.ContainsKey(g)). ToList(); assetDict[guid].dependencies = guids; } } UpdateReferenceInfo(); return true; } //写入缓存 private void WriteToChache() { if (File.Exists(CACHE_PATH)) File.Delete(CACHE_PATH); var serializedGuid = new List<string>(); var serializedDependencyHash = new List<string>(); var serializedDenpendencies = new List<int[]>(); //辅助映射字典 var guidIndex = new Dictionary<string, int>(); //序列化 using (FileStream fs = File.OpenWrite(CACHE_PATH)) { foreach (var pair in assetDict) { guidIndex.Add(pair.Key, guidIndex.Count); serializedGuid.Add(pair.Key); serializedDependencyHash.Add(pair.Value.assetDependencyHash); } foreach(var guid in serializedGuid) { //使用 Where 子句过滤目录 int[] indexes = assetDict[guid].dependencies. Where(s => guidIndex.ContainsKey(s)). Select(s => guidIndex[s]).ToArray(); serializedDenpendencies.Add(indexes); } BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(fs, CACHE_VERSION); bf.Serialize(fs, serializedGuid); bf.Serialize(fs, serializedDependencyHash); bf.Serialize(fs, serializedDenpendencies); } } //更新引用信息状态 public void UpdateAssetState(string guid) { AssetDescription ad; if (assetDict.TryGetValue(guid,out ad) && ad.state != AssetState.NODATA) { if (File.Exists(ad.path)) { //修改时间与记录的不同为修改过的资源 if (ad.assetDependencyHash != AssetDatabase.GetAssetDependencyHash(ad.path).ToString()) { ad.state = AssetState.CHANGED; } else { //默认为普通资源 ad.state = AssetState.NORMAL; } } //不存在为丢失 else { ad.state = AssetState.MISSING; } } //字典中没有该数据 else if(!assetDict.TryGetValue(guid, out ad)) { string path = AssetDatabase.GUIDToAssetPath(guid); ad = new AssetDescription(); ad.name = Path.GetFileNameWithoutExtension(path); ad.path = path; ad.state = AssetState.NODATA; assetDict.Add(guid, ad); } } //根据引用信息状态获取状态描述 public static string GetInfoByState(AssetState state) { if(state == AssetState.CHANGED) { return "<color=#F0672AFF>Changed</color>"; } else if (state == AssetState.MISSING) { return "<color=#FF0000FF>Missing</color>"; } else if(state == AssetState.NODATA) { return "<color=#FFE300FF>No Data</color>"; } return "Normal"; } public class AssetDescription { public string name = ""; public string path = ""; public string assetDependencyHash; public List<string> dependencies = new List<string>(); public List<string> references = new List<string>(); public AssetState state = AssetState.NORMAL; } public enum AssetState { NORMAL, CHANGED, MISSING, NODATA, } }
using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; using UnityEditor.IMGUI.Controls; public class ReferenceFinderWindow : EditorWindow { //依赖模式的key const string isDependPrefKey = "ReferenceFinderData_IsDepend"; //是否需要更新信息状态的key const string needUpdateStatePrefKey = "ReferenceFinderData_needUpdateState"; private static ReferenceFinderData data = new ReferenceFinderData(); private static bool initializedData = false; private bool isDepend = false; private bool needUpdateState = true; private bool needUpdateAssetTree = false; private bool initializedGUIStyle = false; //工具栏按钮样式 private GUIStyle toolbarButtonGUIStyle; //工具栏样式 private GUIStyle toolbarGUIStyle; //选中资源列表 private List<string> selectedAssetGuid = new List<string>(); private AssetTreeView m_AssetTreeView; [SerializeField] private TreeViewState m_TreeViewState; //查找资源引用信息 [MenuItem("Assets/Find References In Project %#&f", false, 25)] static void FindRef() { InitDataIfNeeded(); OpenWindow(); ReferenceFinderWindow window = GetWindow<ReferenceFinderWindow>(); window.UpdateSelectedAssets(); } //打开窗口 [MenuItem("Window/Reference Finder", false, 1000)] static void OpenWindow() { ReferenceFinderWindow window = GetWindow<ReferenceFinderWindow>(); window.wantsMouseMove = false; window.titleContent = new GUIContent("Ref Finder"); window.Show(); window.Focus(); } //初始化数据 static void InitDataIfNeeded() { if (!initializedData) { //初始化数据 if(!data.ReadFromCache()) { data.CollectDependenciesInfo(); } initializedData = true; } } //初始化GUIStyle void InitGUIStyleIfNeeded() { if (!initializedGUIStyle) { toolbarButtonGUIStyle = new GUIStyle("ToolbarButton"); toolbarGUIStyle = new GUIStyle("Toolbar"); initializedGUIStyle = true; } } //更新选中资源列表 private void UpdateSelectedAssets() { selectedAssetGuid.Clear(); foreach(var obj in Selection.objects) { string path = AssetDatabase.GetAssetPath(obj); //如果是文件夹 if (Directory.Exists(path)) { string[] folder = new string[] { path }; //将文件夹下所有资源作为选择资源 string[] guids = AssetDatabase.FindAssets(null, folder); foreach(var guid in guids) { if (!selectedAssetGuid.Contains(guid) && !Directory.Exists(AssetDatabase.GUIDToAssetPath(guid))) { selectedAssetGuid.Add(guid); } } } //如果是文件资源 else { string guid = AssetDatabase.AssetPathToGUID(path); selectedAssetGuid.Add(guid); } } needUpdateAssetTree = true; } //通过选中资源列表更新TreeView private void UpdateAssetTree() { if (needUpdateAssetTree && selectedAssetGuid.Count != 0) { var root = SelectedAssetGuidToRootItem(selectedAssetGuid); if(m_AssetTreeView == null) { //初始化TreeView if (m_TreeViewState == null) m_TreeViewState = new TreeViewState(); var headerState = AssetTreeView.CreateDefaultMultiColumnHeaderState(position.width); var multiColumnHeader = new MultiColumnHeader(headerState); m_AssetTreeView = new AssetTreeView(m_TreeViewState, multiColumnHeader); } m_AssetTreeView.assetRoot = root; m_AssetTreeView.CollapseAll(); m_AssetTreeView.Reload(); needUpdateAssetTree = false; } } private void OnEnable() { isDepend = PlayerPrefs.GetInt(isDependPrefKey, 0) == 1; needUpdateState = PlayerPrefs.GetInt(needUpdateStatePrefKey, 1) == 1; } private void OnGUI() { InitGUIStyleIfNeeded(); DrawOptionBar(); UpdateAssetTree(); if (m_AssetTreeView != null) { //绘制Treeview m_AssetTreeView.OnGUI(new Rect(0, toolbarGUIStyle.fixedHeight, position.width, position.height - toolbarGUIStyle.fixedHeight)); } } //绘制上条 public void DrawOptionBar() { EditorGUILayout.BeginHorizontal(toolbarGUIStyle); //刷新数据 if (GUILayout.Button("Refresh Data", toolbarButtonGUIStyle)) { data.CollectDependenciesInfo(); needUpdateAssetTree = true; EditorGUIUtility.ExitGUI(); } //修改模式 bool PreIsDepend = isDepend; isDepend = GUILayout.Toggle(isDepend, isDepend ? "Model(Depend)" : "Model(Reference)", toolbarButtonGUIStyle,GUILayout.Width(100)); if(PreIsDepend != isDepend){ OnModelSelect(); } //是否需要更新状态 bool PreNeedUpdateState = needUpdateState; needUpdateState = GUILayout.Toggle(needUpdateState, "Need Update State", toolbarButtonGUIStyle); if (PreNeedUpdateState != needUpdateState) { PlayerPrefs.SetInt(needUpdateStatePrefKey, needUpdateState ? 1 : 0); } GUILayout.FlexibleSpace(); //扩展 if (GUILayout.Button("Expand", toolbarButtonGUIStyle)) { if (m_AssetTreeView != null) m_AssetTreeView.ExpandAll(); } //折叠 if (GUILayout.Button("Collapse", toolbarButtonGUIStyle)) { if (m_AssetTreeView != null) m_AssetTreeView.CollapseAll(); } EditorGUILayout.EndHorizontal(); } private void OnModelSelect() { needUpdateAssetTree = true; PlayerPrefs.SetInt(isDependPrefKey, isDepend ? 1 : 0); } //生成root相关 private HashSet<string> updatedAssetSet = new HashSet<string>(); //通过选择资源列表生成TreeView的根节点 private AssetViewItem SelectedAssetGuidToRootItem(List<string> selectedAssetGuid) { updatedAssetSet.Clear(); int elementCount = 0; var root = new AssetViewItem { id = elementCount, depth = -1, displayName = "Root", data = null }; int depth = 0; var stack = new Stack<string>(); foreach (var childGuid in selectedAssetGuid) { var child = CreateTree(childGuid, ref elementCount, depth, stack); if (child != null) root.AddChild(child); } updatedAssetSet.Clear(); return root; } //通过每个节点的数据生成子节点 private AssetViewItem CreateTree(string guid, ref int elementCount, int _depth, Stack<string> stack) { if (stack.Contains(guid)) return null; stack.Push(guid); if (needUpdateState && !updatedAssetSet.Contains(guid)) { data.UpdateAssetState(guid); updatedAssetSet.Add(guid); } ++elementCount; var referenceData = data.assetDict[guid]; var root = new AssetViewItem { id = elementCount, displayName = referenceData.name, data = referenceData, depth = _depth }; var childGuids = isDepend ? referenceData.dependencies : referenceData.references; foreach (var childGuid in childGuids) { var child = CreateTree(childGuid, ref elementCount, _depth + 1, stack); if (child != null) root.AddChild(child); } stack.Pop(); return root; } }