Giter Site home page Giter Site logo

handcircus / unity-resource-checker Goto Github PK

View Code? Open in Web Editor NEW
1.0K 76.0 289.0 46 KB

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)

C# 100.00%

unity-resource-checker's Introduction

// 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!

unity-resource-checker's People

Contributors

black-square avatar federicodangelo avatar jtothebell avatar krawlak avatar mangatome avatar simonoliver avatar talessampaio avatar virtuossq avatar ximera91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-resource-checker's Issues

Doesn't show texture size in Unity 2022. Не показывает размер текстур в Unity 2022

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 то всё отображается как надо, а данный формат похоже не поддерживается.

image

Update Asset Store?

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!

Compile errors on Unity 2017.4.2f2 with v2.1

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

Error CS0246 in Unity 5.3.6f1

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?

Null Check on AnimationClips

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!

Exception when material does not have "_MainTex" property

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))

T is not a Unity Component

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.