├── Documentation~
├── Example.gif
└── Github Header.jpg
├── Editor
├── Resources
│ ├── GuidSearchWindow Icon.psd
│ ├── d_GuidSearchWindow Icon.psd
│ ├── GuidSearchWindow Icon.psd.meta
│ └── d_GuidSearchWindow Icon.psd.meta
├── GuidSearchWindow.uss
├── Extensions.meta
├── Resources.meta
├── RoyTheunissen.GUIDSearch.Editor.asmdef.meta
├── Extensions
│ ├── StringExtensions.cs.meta
│ └── StringExtensions.cs
├── GuidSearchWindow.uxml.meta
├── GuidSearchWindow.uss.meta
├── GuidSearchWindow.cs.meta
├── RoyTheunissen.GUIDSearch.Editor.asmdef
├── GuidSearchWindow.uxml
└── GuidSearchWindow.cs
├── LICENSE.meta
├── README.md.meta
├── package.json.meta
├── Editor.meta
├── package.json
├── LICENSE
└── README.md
/Documentation~/Example.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RoyTheunissen/GUID-Search/HEAD/Documentation~/Example.gif
--------------------------------------------------------------------------------
/Documentation~/Github Header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RoyTheunissen/GUID-Search/HEAD/Documentation~/Github Header.jpg
--------------------------------------------------------------------------------
/Editor/Resources/GuidSearchWindow Icon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RoyTheunissen/GUID-Search/HEAD/Editor/Resources/GuidSearchWindow Icon.psd
--------------------------------------------------------------------------------
/Editor/Resources/d_GuidSearchWindow Icon.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RoyTheunissen/GUID-Search/HEAD/Editor/Resources/d_GuidSearchWindow Icon.psd
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.uss:
--------------------------------------------------------------------------------
1 | .custom-label {
2 | font-size: 20px;
3 | -unity-font-style: bold;
4 | color: rgb(68, 138, 255);
5 | }
6 |
7 | .unity-scroll-view {
8 | }
9 |
--------------------------------------------------------------------------------
/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 12074ca857224324a8e1dfa598600ca5
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9e38349450592e84d9d73787d751b407
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 461401924406e2641890f9555ee5f1c9
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3d8c5a37308c3c748aae10687fddd706
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Extensions.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e05c8648aeb276c45aeb25c09f9dc505
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a35021358fa8a74429cee584309a87cd
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/RoyTheunissen.GUIDSearch.Editor.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c2a5a88d56aace44ab7d6c084e330450
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Editor/Extensions/StringExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 399ffb6d9766d384ba16648d29ce2ae1
3 | timeCreated: 1470404105
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.uxml.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bc70bd56b4b977142bca373beba987cf
3 | ScriptedImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 2
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 | script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
11 |
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.uss.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e0af0fe7f2aa61347b924305628bfc8b
3 | ScriptedImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 2
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 | script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
11 | disableValidation: 0
12 |
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5b3d9aa3980a38042a669a5cbcb52756
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences:
7 | - m_VisualTreeAsset: {fileID: 9197481963319205126, guid: bc70bd56b4b977142bca373beba987cf,
8 | type: 3}
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Editor/RoyTheunissen.GUIDSearch.Editor.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "RoyTheunissen.GUIDSearch.Editor",
3 | "rootNamespace": "RoyTheunissen.GUIDSearch",
4 | "references": ["GUID:343deaaf83e0cee4ca978e7df0b80d21","GUID:2bafac87e7f4b9b418d9448d219b01ab"],
5 | "includePlatforms": [
6 | "Editor"
7 | ],
8 | "excludePlatforms": [],
9 | "allowUnsafeCode": false,
10 | "overrideReferences": false,
11 | "precompiledReferences": [],
12 | "autoReferenced": true,
13 | "defineConstraints": [],
14 | "versionDefines": [],
15 | "noEngineReferences": false
16 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.roytheunissen.guid-search",
3 | "displayName": "GUID Search",
4 | "version": "0.0.3",
5 | "unity": "2022.3",
6 | "description": "Sometimes you really need to find all the places where an asset is being referenced, and Unity's own search solutions are too unreliable for this.",
7 | "keywords": [
8 | "Search",
9 | "Utility",
10 | "Tool",
11 | "Assets"
12 | ],
13 | "author": {
14 | "name": "Roy Theunissen",
15 | "url": "https://www.roytheunissen.com"
16 | },
17 | "category": "Tools",
18 | "homepage": "https://github.com/RoyTheunissen/GUID-Search",
19 | "repository": {
20 | "type": "git",
21 | "url": "https://github.com/RoyTheunissen/GUID-Search"
22 | },
23 | "bugs": "https://github.com/RoyTheunissen/GUID-Search/issues"
24 | }
25 |
--------------------------------------------------------------------------------
/Editor/Extensions/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace RoyTheunissen.GuidSearch
4 | {
5 | internal static class StringExtensions
6 | {
7 | public static string RemovePrefix(this string name, string prefix)
8 | {
9 | if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(prefix))
10 | return name;
11 |
12 | if (!name.StartsWith(prefix))
13 | return name;
14 |
15 | return name.Substring(prefix.Length);
16 | }
17 |
18 | private static readonly char[] DirectorySeparators =
19 | { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
20 |
21 | public static string GetParentDirectory(this string path)
22 | {
23 | int lastDirectorySeparator = path.LastIndexOfAny(DirectorySeparators);
24 | if (lastDirectorySeparator == -1)
25 | return path;
26 |
27 | return path.Substring(0, lastDirectorySeparator);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Roy Theunissen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.uxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Editor/Resources/GuidSearchWindow Icon.psd.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a2215abe3ab71b943a873775025c20e4
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 13
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 1
41 | wrapV: 1
42 | wrapW: 0
43 | nPOTScale: 0
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 1
56 | spriteTessellationDetail: -1
57 | textureType: 2
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 4
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | ignorePlatformSupport: 0
81 | androidETC2FallbackOverride: 0
82 | forceMaximumCompressionQuality_BC6H_BC7: 0
83 | - serializedVersion: 4
84 | buildTarget: Standalone
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | ignorePlatformSupport: 0
94 | androidETC2FallbackOverride: 0
95 | forceMaximumCompressionQuality_BC6H_BC7: 0
96 | spriteSheet:
97 | serializedVersion: 2
98 | sprites: []
99 | outline: []
100 | customData:
101 | physicsShape: []
102 | bones: []
103 | spriteID:
104 | internalID: 0
105 | vertices: []
106 | indices:
107 | edges: []
108 | weights: []
109 | secondaryTextures: []
110 | spriteCustomMetadata:
111 | entries: []
112 | nameFileIdTable: {}
113 | mipmapLimitGroupName:
114 | pSDRemoveMatte: 1
115 | userData:
116 | assetBundleName:
117 | assetBundleVariant:
118 |
--------------------------------------------------------------------------------
/Editor/Resources/d_GuidSearchWindow Icon.psd.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f43d3628f6251c64aaae65da72800f5f
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 13
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 0
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | flipGreenChannel: 0
24 | isReadable: 0
25 | streamingMipmaps: 0
26 | streamingMipmapsPriority: 0
27 | vTOnly: 0
28 | ignoreMipmapLimit: 0
29 | grayScaleToAlpha: 0
30 | generateCubemap: 6
31 | cubemapConvolution: 0
32 | seamlessCubemap: 0
33 | textureFormat: 1
34 | maxTextureSize: 2048
35 | textureSettings:
36 | serializedVersion: 2
37 | filterMode: 1
38 | aniso: 1
39 | mipBias: 0
40 | wrapU: 1
41 | wrapV: 1
42 | wrapW: 0
43 | nPOTScale: 0
44 | lightmap: 0
45 | compressionQuality: 50
46 | spriteMode: 0
47 | spriteExtrude: 1
48 | spriteMeshType: 1
49 | alignment: 0
50 | spritePivot: {x: 0.5, y: 0.5}
51 | spritePixelsToUnits: 100
52 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
53 | spriteGenerateFallbackPhysicsShape: 1
54 | alphaUsage: 1
55 | alphaIsTransparency: 1
56 | spriteTessellationDetail: -1
57 | textureType: 2
58 | textureShape: 1
59 | singleChannelComponent: 0
60 | flipbookRows: 1
61 | flipbookColumns: 1
62 | maxTextureSizeSet: 0
63 | compressionQualitySet: 0
64 | textureFormatSet: 0
65 | ignorePngGamma: 0
66 | applyGammaDecoding: 0
67 | swizzle: 50462976
68 | cookieLightType: 0
69 | platformSettings:
70 | - serializedVersion: 4
71 | buildTarget: DefaultTexturePlatform
72 | maxTextureSize: 2048
73 | resizeAlgorithm: 0
74 | textureFormat: -1
75 | textureCompression: 1
76 | compressionQuality: 50
77 | crunchedCompression: 0
78 | allowsAlphaSplitting: 0
79 | overridden: 0
80 | ignorePlatformSupport: 0
81 | androidETC2FallbackOverride: 0
82 | forceMaximumCompressionQuality_BC6H_BC7: 0
83 | - serializedVersion: 4
84 | buildTarget: Standalone
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | ignorePlatformSupport: 0
94 | androidETC2FallbackOverride: 0
95 | forceMaximumCompressionQuality_BC6H_BC7: 0
96 | spriteSheet:
97 | serializedVersion: 2
98 | sprites: []
99 | outline: []
100 | customData:
101 | physicsShape: []
102 | bones: []
103 | spriteID:
104 | internalID: 0
105 | vertices: []
106 | indices:
107 | edges: []
108 | weights: []
109 | secondaryTextures: []
110 | spriteCustomMetadata:
111 | entries: []
112 | nameFileIdTable: {}
113 | mipmapLimitGroupName:
114 | pSDRemoveMatte: 1
115 | userData:
116 | assetBundleName:
117 | assetBundleVariant:
118 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](http://roytheunissen.com)
2 | [](LICENSE.md)
3 | 
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | _Sometimes you really need to find all the places where an asset is being referenced, and Unity's own search solutions are too unreliable for this._
26 |
27 | ## About the Project
28 |
29 | Let's say you removed a script from your game, and you want to ensure that it's also removed from scenes/prefabs. You might be inclined to use `Right Click -> Find References in Project`, which opens a Search window which will be thinking and processing for a very, very long time and then will then output _some_ results.
30 |
31 | In practice I've found that it won't find usages in scenes unless those scenes happen to be open, and its track record is spotty with prefabs, too.
32 |
33 | In other words: if you're doing an important refactor and _must_ know all the places an asset's referenced, Unity Search will not suffice.
34 |
35 | But every asset has a GUID, so you could simply search the contents of assets for that GUID. In fact, you could do it in [Notepad++](https://notepad-plus-plus.org/) pretty easily:
36 | - Go to the asset in question in Unity
37 | - `Right Click -> Show in Explorer`
38 | - Go to the asset in question's `.meta` file
39 | - Copy the GUID
40 | - Press `CTRL+Shift+F` or go to to `Search > Find in Files`
41 | - Search for the specified GUID in files with pattern `*.unity *.prefab` in your project's `Assets` folder.
42 | - This will think only for a few seconds and then output a list of **every** reference to that asset.
43 | - You can then search for that asset by name in Unity
44 |
45 | This is a very robust approach, but of course you have to leave the editor for this, and there's a lot of manual labour involved. GUID Search is essentially just a nice GUI for the above mentioned workflow:
46 |
47 | 
48 |
49 | When doing important refactors, this tool is simple, fast, and thorough enough to get the job done.
50 |
51 | It is guaranteed to find *every* possible reference.
52 |
53 | ## Use Cases
54 | - You want to remove a script, but before you do you want to check where it's being used.
55 | - There's a problem with a shader, so you want to find all the materials that use that shader.
56 | - You're cleaning up a folder called `Archived` but you want to check that the Scriptable Object inside is genuinely not being used any more.
57 | - Etc.
58 |
59 | ## Getting Started
60 |
61 | - Open the GUID Search window via `Window > Search > GUID Search`
62 | 
63 |
64 | - Drag in an asset in the `Asset to find` field.
65 | - The GUID for the asset in question will appear.
66 | - Specify the types of files to search in.
67 | - Specify the folder to search in.
68 | - Press Search.
69 | - Observe how all the assets that reference the specified asset are listed, and you can click on them to open them.
70 |
71 | 
72 |
73 | _Pictured: A script that is referenced inside a specific scene will be found even if that scene is not open, something that Unity's own Search solution does not seem to do._
74 |
75 | ## Caveats
76 | - If you have a reference to an asset in a script, then remove that field from the script, the assets that had the reference will continue to have the reference until you modify and save the asset. You can see this happening in your version control software. It makes sense if you think about it: if you remove a field from a script you don't see Unity start a lengthy process of purging all the references of that field from its prefabs and scenes, polluting your working copy with a lot of changes. **This also means that if you have any such leftover references lying around, GUID Search will find those as well**. GUID Search will find **everything**, and it's up to you to filter out such false positives.
77 | - If you have a reference somewhere deep in a complicated prefab or scene, GUID Search is not able to tell you _where_ inside that complicated prefab or scene. It's then up to you to go looking for the exact reference.
78 |
79 | ## Feature Wishlist
80 | - Some (optional?) way to check if a reference is from a script, and then to check if that script does indeed still contain the specified field. If not, we could filter out search results for references that are not in use.
81 | - Some (optional?) way to locate the exact location of a reference inside of a prefab or script. This might be tricky, we may have to parse the asset a bit. There's also the question of how to present this in the GUI.
82 |
83 | ## Compatibility
84 |
85 | This system was developed for Unity 2022, it's recommended that you use it in Unity 2022 or upwards. It's been tested in Unity 6 as well and seems to work the same there.
86 |
87 | If you use an older version of Unity and are running into trouble, feel free to reach out and I'll see what I can do.
88 |
89 | The GUI was developed with UI Toolkit and the functionality is pretty basic, so this tool will likely work across a wide range of Unity versions.
90 |
91 | ## Installation
92 |
93 | ### Package Manager
94 |
95 | Go to `Edit > Project Settings > Package Manager`. Under 'Scoped Registries' make sure there is an OpenUPM entry.
96 |
97 | If you don't have one: click the `+` button and enter the following values:
98 |
99 | - Name: `OpenUPM`
100 | - URL: `https://package.openupm.com`
101 |
102 | Then under 'Scope(s)' press the `+` button and add `com.roytheunissen`.
103 |
104 | It should look something like this:
105 | 
106 |
107 |
108 | All of my packages will now be available to you in the Package Manager in the 'My Registries' section and can be installed from there.
109 |
110 |
111 |
112 | ### Git Submodule
113 |
114 | You can check out this repository as a submodule into your project's Assets folder. This is recommended if you intend to contribute to the repository yourself.
115 |
116 | ### OpenUPM
117 | The package is available on the [openupm registry](https://openupm.com). It's recommended to install it via [openupm-cli](https://github.com/openupm/openupm-cli).
118 |
119 | ```
120 | openupm add com.roytheunissen.guid-search
121 | ```
122 |
123 | ### Manifest
124 | You can also install via git URL by adding this entry in your **manifest.json** (make sure to end with a comma if you're adding this at the top)
125 |
126 | ```
127 | "com.roytheunissen.guid-search": "https://github.com/RoyTheunissen/GUID-Search.git"
128 | ```
129 |
130 | ### Unity Package Manager
131 | From Window->Package Manager, click on the + sign and Add from git:
132 | ```
133 | https://github.com/RoyTheunissen/GUID-Search.git
134 | ```
135 |
136 |
137 | ## Contact
138 | [Roy Theunissen](https://roytheunissen.com)
139 |
140 | [roy.theunissen@live.nl](mailto:roy.theunissen@live.nl)
141 |
--------------------------------------------------------------------------------
/Editor/GuidSearchWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using UnityEditor;
6 | using UnityEditor.UIElements;
7 | using UnityEngine;
8 | using UnityEngine.UIElements;
9 | using EditorUtility = UnityEditor.EditorUtility;
10 | using Object = UnityEngine.Object;
11 |
12 | namespace RoyTheunissen.GuidSearch
13 | {
14 | public sealed class GuidSearchWindow : EditorWindow
15 | {
16 | [Flags]
17 | public enum AssetTypes
18 | {
19 | Scenes = 1 << 0,
20 | Prefabs = 1 << 1,
21 | ScriptableObjects = 1 << 2,
22 | Materials = 1 << 3,
23 | }
24 |
25 | private static readonly Dictionary assetTypeToExtensions = new()
26 | {
27 | { AssetTypes.Scenes, new[] { ".unity" } },
28 | { AssetTypes.Prefabs, new[] { ".prefab" } },
29 | { AssetTypes.ScriptableObjects, new[] { ".asset" } },
30 | { AssetTypes.Materials, new[] { ".mat" } },
31 | };
32 |
33 | private static string cachedProjectPath;
34 |
35 | private static string ProjectPath
36 | {
37 | get
38 | {
39 | if (cachedProjectPath == null)
40 | {
41 | string assetsFolder = Application.dataPath;
42 | string projectFolder = assetsFolder.GetParentDirectory();
43 |
44 | // Path up something like C:/Git/YourProjectName/ so it's unique to your checkout.
45 | cachedProjectPath = projectFolder + "/";
46 | }
47 |
48 | return cachedProjectPath;
49 | }
50 | }
51 |
52 | private static string EditorPrefPrefix => ProjectPath + "RoyTheunissen/GUID-Search/";
53 | private static string EditorPrefSearchPath = EditorPrefPrefix + "SearchPath";
54 | private static string EditorPrefAssetsToSearchIn = EditorPrefPrefix + "AssetsToSearchIn";
55 |
56 | [SerializeField]
57 | private VisualTreeAsset m_VisualTreeAsset = default;
58 |
59 | private ObjectField assetField;
60 | private TextField guidField;
61 | private MaskField filesToSearchInField;
62 | private TextField pathField;
63 | private Button browseButton;
64 | private Button searchButton;
65 | private ListView resultsListView;
66 |
67 | private List