• Stars
    star
    119
  • Rank 288,664 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plugin to display dependencies between assets, files, assetgroups, etc. in a tree based view within the Unity editor.

Asset Relations Viewer

Plugin to display dependencies between assets, files, assetgroups, etc. in a tree based view within the Unity editor.





Features

  • Standalone Editor UI without any external dependencies
  • View which dependencies an asset has to other assets
  • View which assets have the given asset as a dependency
  • Show thumbnails of all assets in the dependency tree
  • filter for Asset Names and Asset Types in displayed tree
  • Highlight if an asset is used in the project (going to be packed in the app)
  • Show path of where an asset is used exactly within a scene, prefab or asset
  • Display byte size of compressed asset together with overall size of dependency tree
  • Extendable by own dependency resolvers, for example to show addressables
  • Support additional connection- and nodetypes which can be added via addons, for example:
    • Addressable Groups
    • Addressables
    • AssetBundles
    • LocaKeys
    • AssemblyDefinitions
    • Etc.





Installation

For Unity 2018.3 or later (Using Unity Package Manager)

Find the manifest.json file in the packages folder of your project and edit it to look like this:

{
  "dependencies": {
    "com.innogames.asset-relations-viewer": "https://github.com/innogames/asset-relations-viewer.git",
    ...
  },
}

If you are in production and not want to get automatic updates always use a tagged version like:

	...
    "com.innogames.asset-relations-viewer": "https://github.com/innogames/asset-relations-viewer.git#VERSION_TAG",
    ...





First Usage

  1. Select an asset within the unity project explorer
  2. Right click to open context menu for an asset
  3. Select "Show in Asset Relations Viewer"
  4. On Dialog for the first startup of AssetRelationsViewer click on yes
  5. Wait for the resolver to find all dependencies for all assets in the project which can take a while for a large project with many assets





Controls

Menu items

Menu items sorted from left to right


Back button ("<<"): Button to go back to previous selected asset to view
Thumbnail Size: Size of the thumbnails in pixels
Node Depth: Depth of the shown tree structure
Refresh: Updates dependencies and refreshes view after asset has changed
Save and Refresh: Saves the project before refresh
Clear and Refresh: Clears cache before refresh to force a complete rebuild of all caches
**Show additional node information **: Displays size and also type of the nodes
Show Thumbnails: Shows correct thumbnails on nodes if available
Show nodes Once: To only show each node (Asset) once within the displayed tree
Show hierarchy Once: To only show the same dependency hierarchy for a node once within the displayed tree
Show referencers: If referencers (Assets that have the selected asset as a dependency) should be shown or not
Show Property Pathes: Shows path of dependency (GameObject->Components->ClassMemberVariable)
Align Nodes: If all nodes of the same depth should be aligned horizontally in the displayed tree
Hide Filtered Nodes: Hide all nodes that are filtered out instead of just graying them out
Highlight packaged assets: Adds green highlight to nodes which are going to be packed into the app (Are actually used by the game)
Merge Relations: If a node has the same asset as a dependency multiple times, the same dependency is just shown once

Node

s: If the selected node is an asset, it will be selected in the unity project explorer
>: Sets node as currently selected node





Dependency type list

The AssetRelationViewer can display several types of dependencies. In order for them to show up these need to be selected first.

After selecting a dependency type that is currently not loaded the Load caches button need to be clicked on in order to finally load the dependency types.
Unused dependency types can be unloaded by clicking on the U button.

L Dependency type is active and currently loaded
R Dependency type got activated but needs to be loaded
U Dependency type got deactivated and can be unloaded
R Button Refreshes the dependencies just for this dependency type

Dependency types

Asset->Asset by Object

Dependencies of assets to assets by a UnityEngine.Object reference.

Asset->File

Dependencies of assets to the file they are part of.
This is required since a file can have several subassets meaning that an asset is not automatically the file itself even though most files only contain a single asset.
Note: Only the file itself has size information about the assets it contains. So in order to get size information with the "Show additional node information" this dependecy type need to be enabled

Scene GameObject->GameObject

Dependencies of GameObject to GameObjects within the currently loaded scene or prefab.
If an in scene GameObject is selected as the viewed node only GameObject->GameObject dependencies are shown. The GameObject->GameObject dependency view can not be viewed together with other dependencies.
Note: If the opened scene/prefab changed after opening the AssetRelationViewer the cache needs to be refreshed.

AsmDef->AsmDef

Dependencies between AssemblyDefinitions to other AssemblyDefinitions as well as AssemblyDefinitionReferences to AssemblyDefinitions

Caching

Most dependency types are cached to only update the dependencies again if the file itself got changed.
This greatly reduces the startup time of the AssetRelationsViewer since for large projects finding all Asset->Asset dependencies can take several minutes. If a file needs to be updated is currently determinined by the timestamp of the file but could be changed to in addition also take a file hash into account.

Location

The caches are stored in PROJECT_ROOT/NodeDependencyCache.
Dependending on the projectsize these files can be several several megabytes in size.
The NodeDependencyCache folder should be added to .gitignore and not be checked in into the git repository.

Clearing the cache

The cache files can either be deleted manually or inside Unity under the Window/Node Dependency Cache/Clear Cache Files menu item.





Node search and filter

Node search

Since every type of node can be viewed in the AssetRelationViewer like Assets, Files, AddressableAssetGroups, AsmDefs, etc. is sometime helpful to have a generic node search.
Because finding all nodes in the projects might take a while this feature needs to be activated first by clicking on the "Enable" botton.
Only known nodes based on the activated dependency types are shown, meaning that if for example no asset related dependency type is active no assets can be found in the node search.
Nodes can be searched for by name and by type.
Based on the filtered name and type the dropdown will show all available nodes to select.
Once selected in the dropdown the current node can be shown in the AssetRelationsViewer by clicking Select.

Node hierarchy filter

To specifically filter for either a node name or node type the "Node hierarchy filter:" can be used.
Only the matching nodes will be highlighted and all others are grayed out.
In the example the dependency tree is filtered for "vertexLit".





Showing dependency pathes

In the AssetRelationsViewer it is possible to not only view dependencies between Asset->Asset for example but also exactly through with path the dependency exist.
In order to view the pathes "Show Property Pathes" needs to be activated.
Once active the whole path of the dependency (GameObject->Components->ClassMemberVariable) is shown in the hierarchy tree view.

Node handlers

GUI options specific to a node type.

Asset

Options specific to Assets.

Contains dropdown to select an asset in the project.
Sync to explorer: If selected the currently selected asset in the project explorer will be the one shown in the AssetRelationsViewer.

File

Options specific to Files.
Currently there are no specific options for them.

InSceneGameObject

Options for in scene GameObjects.

Contains dropdown to select a GameObject from the currently opened scene/prefab.
Sync to hierarchy: If selected the currently selected GameObject in the currently opened scene/prefab will be shown in the AssetRelationsViewer.





Troubleshooting

There can be cases where no tree is shown in the AssetRelationsViewer

  • Make sure a node (Asset) is selected to be shown
  • Make sure a dependency cache (AssetDependencyCache) and dependency resolver (ObjectDependencyResolver) is selected, otherwise no dependency can be found
  • After a code recompile the dependency cache needs to be updated by clicking on "Refresh"
  • Some dependency types might not update/work correctly when being in PlayMode
  • There might be some rare cases where the cache didnt get updated correctly. If there are dependencies missing which you are sure should be displayed sometimes also complete cache rebuild with a Clean and Refresh can help.





Standalone dependency cache

The dependency cache can be used without the AssetRelationsViewer.
This makes it possible to use the cache for other tools where dependency information between assets, files, etc. is required.
In the following example we find out which asset have a dependency on the BaseProductions prefab.

NodeDependencyLookupContext context = new NodeDependencyLookupContext();
ResolverUsageDefinitionList resolverList = new ResolverUsageDefinitionList();

resolverList.Add<AssetDependencyCache, ObjectSerializedDependencyResolver>(true, true, true);
resolverList.Add<AssetToFileDependencyCache, AssetToFileDependencyResolver>(true, true, true);

NodeDependencyLookupUtility.LoadDependencyLookupForCaches(context, resolverList);

// Get guid for BaseProductions prefab
string[] assetGuids = AssetDatabase.FindAssets("t:prefab BaseProductions");

// Nodehandlers to get further information about nodes like the name, type, size, etc.
AssetNodeHandler assetNodeHandler = new AssetNodeHandler();

// Get the node for the file
Node node = context.RelationsLookup.GetNode(assetGuids[0], FileNodeType.Name);

// Iterate over all referencers of the file (assets)
foreach (Connection referencer in node.Referencers)
{
	if (referencer.Node.Type == AssetNodeType.Name)
	{
		// Get name and type of asset
		assetNodeHandler.GetNameAndType(referencer.Node.Id, out string nodeName, out string nodeType);
		
		foreach (Connection assetreferencer in referencer.Node.Referencers)
		{
			assetNodeHandler.GetNameAndType(assetreferencer.Node.Id, out string refNodeName, out string refNodeType);
			
			Debug.LogWarning($"[{nodeType}]{nodeName} is directly referenced by [{refNodeType}]{refNodeName}");
		}
	}
}

Executing this would result in the following output
[GameObject]BaseProductions is directly referenced by [GameObject]ProductionTabContent

For this script to work in your own project the name and type of the asset in AssetDatabase.FindAssets() needs to be adapted accordingly to an asset that exists in your project.





Addons

Support to display different connection and node types can be added by addons.

Addressable system

An addon is available to add support for showing addressables and also addressable groups from Unitys Addressables system.
The Package is called asset-relations-viewer-addressables.
It can be found at https://github.com/innogames/asset-relations-viewer-addressables

Writing own addons to support custom connection- and nodetypes

Own addons can be also added so custom dependencies with any nodetype and dependency type can be added to be viewed inside the Asset Relations Viewer.
For seing how to add own addons, please have a look at the Addressable sytem addon source code.

More Repositories

1

igcommit

Git pre-receive hook to check commits and code style
Python
216
star
2

ltc

Online web application-dashboard for report analyzing,running and online monitoring of load tests started with JMeter
Python
191
star
3

slack-bot

Ready to use Slack bot for lazy developers: start Jenkins jobs, watch Jira tickets, watch pull requests with AI support...
Go
165
star
4

polysh

Polysh, the remote shell multiplexer
Python
63
star
5

ProjectWindowDetails

Unity Editor extension to add columns into the project window for showing additional information about assets
C#
58
star
6

serveradmin

Configuration management database system of InnoGames
Python
43
star
7

ax3

AS3 to Haxe converter
Haxe
40
star
8

igmonplugins

Nagios plugins from InnoGames
Python
26
star
9

graphite-ch-optimizer

Daemon to optimize GraphiteMergeTree automatically
Go
24
star
10

asset-relations-viewer-addressables

C#
20
star
11

igvm

InnoGames VM provisioning tool
Python
15
star
12

tcpause

TCPause is a zero-downtime proxy for TCP and UNIX sockets written in Go.
Go
13
star
13

igcollect

Graphite data collector scripts from InnoGames
Python
13
star
14

pirate

Realtime metrics server written in Go
Go
12
star
15

springfox-protobuf

Glue for SpringFox to support Protobuf Messages
Java
12
star
16

flink-real-time-crm

Demo Flink and Kafka project to show how to react on tracking events in real-time and trigger offer for customer engagement based on campaign configurations. The project also utilizes the Broadcast State Pattern in order to update the rules (campaigns) at runtime without restarting the project, using a dedicated, low-frequency, Kafka topic.
Java
10
star
17

drac_config

Collection of shell scripts for managing iDRACs.
Shell
8
star
18

testtool

Load balancing service of InnoGames
C++
8
star
19

android-ndk

C
7
star
20

puppet-adminapi

Ruby
6
star
21

slaxy

Sentry webhooks to slack message converter proxy
Go
6
star
22

deb-drop

Http fastCGI web server for provide simple and secure access for managing Debian packages in repositories
Go
5
star
23

AS3Communicator

AS3Communicator lets you connect your AS3 application's DisplayList to the outside world like JavaScript
ActionScript
5
star
24

openfl-mark

Benchmark scenes for OpenFL
Haxe
4
star
25

junit5-scenario-builder

Junit5 extension that introduces a Scenario Builder to your tests
Java
4
star
26

unity-meetup

Hamburg Unity Meetup repository with slides from Meetup events
4
star
27

AS3-DomainMemoryManager

A manager for domain memory access in Adobe AIR/Flash.
ActionScript
4
star
28

StarCrash

An InnoDay project. First person SCIFI dungeon crawler.
JavaScript
4
star
29

kafka-client

This library offers an easy way to consume messages from Kafka using more then a single thread by creating a container with consumer.
Java
4
star
30

jobs

Open Positions at InnoGames
Python
3
star
31

dr-json

Manage content of JSON files based on JSON Schemas
TypeScript
3
star
32

puppet-clickhouse

Install and manage ClickHouse DBMS Requires for xml-simple ruby gem to be installed
Ruby
3
star
33

jenkins-build-metrics

A simple wrapper to report failed jenkins jobs to graphite
Go
2
star
34

canirunit

CanYouRunIt Tool is a simple application built in PHP that will allow you to validate your environment for a specific set of constraints set by you such as PHP Modules, PHP Configurations, Databases, Work Queues and more.
PHP
2
star
35

igcolors

Provide a simple module to colourize string for console output
Python
2
star
36

jenkins-lib

This library is used as adminLibs in InnoGames GmbH Jenkins instances
Groovy
2
star
37

flink-real-time-crm-ui

Demo UI for the flink-real-time-crm project using Spring Boot with Thymeleaf. The Demo UI is able to send messages to and consume from the related Kafka topics.
Java
2
star
38

stdin-rotate

Rotates logs reading content from stdin
Go
1
star
39

traffic_dots

A DOTS experiment on traffic simulation
C#
1
star
40

CollectionIconTool

A Unity tool to generate icon variations
C#
1
star
41

jmeter-test-plans

1
star
42

homebrew-core-ig

Ruby
1
star
43

xhprofui

A new gui for xhprof
PHP
1
star
44

hashpipe

Python
1
star
45

hosts-editor

A Gradle plugin that creates a new hosts file with defined entries based on your local hosts file.
Groovy
1
star