handcircus / unity-resource-checker Goto Github PK
View Code? Open in Web Editor NEWEditor utility for unity to help check resources in the current scene (including active textures, their sizes, materials, meshes and which objects are using them)
Editor utility for unity to help check resources in the current scene (including active textures, their sizes, materials, meshes and which objects are using them)
// Unity Resource Checker // (c) 2012 Simon Oliver / HandCircus / [email protected] // https://github.com/handcircus/Unity-Resource-Checker // Public domain, do with whatever you like, commercial or not // This comes with no warranty, use at your own risk! Resource checker is designed to help bring visibility to resource use in your scenes (ie what assets are using up memory, which meshes are a bit too detailed, where are my materials and textures being used). It should also be useful to check for redundant materials, textures you forget you're using, textures that can be compressed or reduced in size. To use, just create an "Editor" folder within "Assets" in your project if you don't already have one, and drop ResourceChecker.cs in there. In Unity you'll see a new option under "Window" -> "Resource Checker" To use, once the window is open, just click 'Refresh' and it will list all active textures, materials and meshes in the scene Textures -------- - Textures are listed in descending memory size - Click the texture name to open the asset in the project window - The size of the texture, compression type and dimensions are show - Click the 'X Mat' button to select all materials that use this texture in the scene - Click the 'X GO' to select all game objects in the scene that use this texture Materials --------- - Click the material name to open the material asset in the project window - Click the 'X GO' to select all game objects in the scene that use this material Meshes ------ - Meshes are listed in descending vertex count - Click the mesh name to open the mesh in the project window - Click the 'X GO' to select all game objects in the scene that use this mesh Its probably got a bunch of bugs and weird issues - feel free to help improve, fix up!
Give feedback if you saw my message!
Most likely, it's in the format that unity chooses by default. That is, if you change it to RGB32, then everything is displayed as it should, and this format does not seem to be supported.
Дайте обратную связь если увидели моё сообщение!
Скорее всего дело в формате, который юнити выбирает по умолчанию. То есть если поменять на RGB32 то всё отображается как надо, а данный формат похоже не поддерживается.
in void CheckResources()
if (lightmapData.lightmapDir != null)
{
var textureDetail = GetTextureDetail(lightmapData.lightmapColor); // should be lightmapDir
if (!ActiveTextures.Contains(textureDetail))
ActiveTextures.Add(textureDetail);
}
Love this utility and I have been using it for a while. I noticed it stopped working for me when I upgraded to Unity 5 (it was reporting 0 resources in play mode even after a refresh). I checked the Asset Store to make sure I had the latest version which I did. Thankfully I checked the github repo because this version worked! Have we lost access to update this asset in the Asset Store?
Thanks for such a great resource!
When multiple scenes are in the Hierarchy the Checker will throw a "scene not loaded exception". This occurs regardless of whether or not they are listed in your Build Settings.
Has the following compile errors on Unity 2017.4.2f2. Resource Checker v2.1.
Assets/Editor/ResourceChecker.cs(286,23): error CS0117: UnityEngine.TextureFormat' does not contain a definition for
ATF_RGB_DXT1'
Assets/Editor/ResourceChecker.cs(287,23): error CS0117: UnityEngine.TextureFormat' does not contain a definition for
ATF_RGBA_JPG'
Assets/Editor/ResourceChecker.cs(288,23): error CS0117: UnityEngine.TextureFormat' does not contain a definition for
ATF_RGB_JPG'
Assets/Editor/ResourceChecker.cs(783,10): error CS0103: The name ac' does not exist in the current context Assets/Editor/ResourceChecker.cs(796,26): error CS0103: The name
cnt' does not exist in the current context
Assets/Editor/ResourceChecker.cs(805,29): error CS0103: The name m' does not exist in the current context Assets/Editor/ResourceChecker.cs(807,29): error CS0103: The name
m' does not exist in the current context
Assets/Editor/ResourceChecker.cs(376,65): error CS0246: The type or namespace name Texture2DArray' could not be found. Are you missing a using directive or an assembly reference? Assets/Editor/ResourceChecker.cs(395,67): error CS0246: The type or namespace name
Texture2DArray' could not be found. Are you missing a using directive or an assembly reference?
Assets/Editor/ResourceChecker.cs(396,56): error CS0246: The type or namespace name Texture2DArray' could not be found. Are you missing a using directive or an assembly reference? Assets/Editor/ResourceChecker.cs(1027,40): error CS0246: The type or namespace name
Texture2DArray' could not be found. Are you missing a using directive or an assembly reference?
Assets/Editor/ResourceChecker.cs(1028,56): error CS0246: The type or namespace name `Texture2DArray' could not be found. Are you missing a using directive or an assembly reference?
Line 647 misses a null check:
Original:
if (m != null)
{
AnimationClip clip = m as AnimationClip;
EditorCurveBinding[] ecbs = AnimationUtility.GetObjectReferenceCurveBindings(clip);
Fixed:
if (m != null)
{
AnimationClip clip = m as AnimationClip;
if (clip != null)
{
EditorCurveBinding[] ecbs = AnimationUtility.GetObjectReferenceCurveBindings(clip);
Thx for sharing this very useful Asset!
Crunched textures do not calculate.
As stated, when material does not have "_MainTex" property, script will spam in console errors.
Solution is to change:
Line 360
from
if (tDetails.material.mainTexture!=null) GUILayout.Box(tDetails.material.mainTexture, GUILayout.Width(ThumbnailWidth), GUILayout.Height(ThumbnailHeight));
to
if (tDetails.material.HasProperty("_MainTex") && tDetails.material.mainTexture!=null) GUILayout.Box(tDetails.material.mainTexture, GUILayout.Width(ThumbnailWidth), GUILayout.Height(ThumbnailHeight));
Line 564
from
if (tMaterial.mainTexture != null && !dependencies.Contains(tMaterial.mainTexture))
to
if (tMaterial.HasProperty("_MainTex") && tMaterial.mainTexture != null && !dependencies.Contains(tMaterial.mainTexture))
Every time I compile within visual studio, the console window prints out the following:
------ Build started: Project: Assembly-CSharp-Editor, Configuration: Debug Any CPU ------
C:\Code\MyProject\Assets\Editor\ResourceChecker.cs(970,10): info UNT0014: T is not a Unity Component
C:\Code\MyProject\Assets\Editor\ResourceChecker.cs(971,24): info UNT0014: T is not a Unity Component
========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ==========
Is this normal?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.