Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the unity reference lookup plug-in ReferenceFinder

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "unity reference search plug-in ReferenceFinder usage", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn the use of the unity reference lookup plug-in ReferenceFinder.

Brief introduction

   this is a plug-in used to find resource references and dependencies, through the cache to save the reference information between resources, through the tree structure intuitive display.

Because    is implemented through caching, you need to flush the cache when you want to get the exact reference information. However, due to the existence of the cache, in the case of less resource changes, the refresh speed is faster and has little impact on the use.

   drag the folder directly into the project to use it.

Use the example

   right need to find the referenced files or folders, click Find References to find.

Button meaning:

Refresh Data: refresh cache

Model: switching references and dependencies

NeedUpdateState: whether the State column needs to be updated based on the status of the current file.

Expand: expand list

Collapse: collapse list

The State in the third column of    is Changed, which means that the resource has been modified, Missing represents that the resource has been deleted, and No Data represents that there is no information about the resource in the cache.

Realize the choice of scheme

1. Make a global search every time you need to find it, to ensure the correctness of the search. However, global lookup can be slow, because the interface GetDependencies for finding resource dependency information is essentially a search for text (for example, guiid and fileid of resources referenced by prefab are recorded in text in prefab), which is a slow process without multithreaded query optimization, which is slower when stored on a mechanical hard disk.

two。 Make a global lookup to generate the cache, read the cache directly during the lookup (the reference information will be inaccurate when the resource changes), and update the cache when the resource changes to keep the lookup correct. However, due to the existence of the cache, the refresh speed is faster when the resource does not change much.

   chose option two here.

Find and cache

Generation of reference information:

   gets all the resource paths in the project through AssetDatabase.GetAllAssetPaths ().

   uses AssetDatabase.GetDependencies () to get information about the resources on which each resource depends.

After these two steps,    has dependency information for all resources.

Through the dependency information of resources,    can generate reference information for all resources.

Cache:

   in order to keep the cache as small as possible, the cache only stores the guid of each resource, the hash value of the referenced resource, and the information that depends on the resource.

   is used to determine whether the resource on which the resource depends has been modified when referencing the hash value of the resource. If so, the dependency information of the resource needs to be read again when the resource reference information is refreshed, otherwise the information will continue to be used. This judgment is the key to reducing refresh time when there are few resource changes.

When recording the dependency,    does not directly record the guid of the dependent resource, but records the location of the subscript of the resource in the cache, thus further reducing the size of the cache.

Interface realization

   mainly uses the TreeView that comes with Unity to display the tree interface.

Project link: Reference Finder

(https://github.com/blueberryzzz/ReferenceFinder)

At this point, I believe you have a deeper understanding of the use of the unity reference lookup plug-in ReferenceFinder, so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report