Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Sep 30, 2014 at 10:28 AM by Griffo for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Griffo · Sep 30, 2014 at 07:51 AM ·

Find ALL game objects containing the same scrip

Hi,

Is it possible to find ALL game objects containing the same script in my project, or does anyone know of a pug in ?

The reason I ask is over the years if created so many scripts and I'm sure some of them now are not needed or used by any game object so would like to delete them because I'm on a quest to clean up my project.

Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by GameVortex · Sep 30, 2014 at 08:26 AM

Then there is this: http://answers.unity3d.com/questions/223434/find-all-assets-by-type.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by GameVortex · Sep 30, 2014 at 07:59 AM

You can use the Static function FindObjectsOfType from the class Object. This finds only objects in the Scene basically, or did you want a way to find prefabs which use the script as well?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Griffo · Sep 30, 2014 at 08:03 AM 0
Share

Thanks for the reply, I'm looking to search through my project, scene, Asset folder and it's hierarchy, my project not just my scene as I might have a game object in a folder using the script but not yet placed in the scene.

avatar image Griffo · Sep 30, 2014 at 08:42 AM 0
Share

Thats what I needed, thank you, please convert your comment to an answer so I can except it.

avatar image GameVortex · Sep 30, 2014 at 09:59 AM 0
Share

Converted Comment to Answer

avatar image
0

Answer by Kiwasi · Sep 30, 2014 at 08:36 AM

There is another method.

Back up your project. Delete the scripts. See what breaks.

Not saying its a good solution.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Griffo · Sep 30, 2014 at 08:38 AM 0
Share

Bored$$anonymous$$ormon .. lol .. I did think of that

avatar image Kiwasi · Sep 30, 2014 at 08:48 AM 0
Share

Actually now that I think of it you could put a Debug.Log in Awake that provides you with a pointer to the object. Its not a bullet proof solution by any means, but it will tell you if any GameObjects currently in use need the script.

avatar image gjf · Sep 30, 2014 at 09:04 AM 0
Share

rename the file (& the defined class if it's c#) and look for compile/runtime errors

avatar image Griffo · Sep 30, 2014 at 09:27 AM 0
Share

Yeah but I'm looking to search through my project, scene, Asset folder and it's hierarchy, my project not just my scene as I might have a game object in a folder using the script but not yet placed in the scene.

Think GameVortex link above is the answer ..

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Fps Aiming Script help 2 Answers

How do I get each GameObject to mind its own business? 1 Answer

Why does this script make my camera upside down? 0 Answers

Search game objects with script 1 Answer

camera script, allow free movement of the camera up to a certain distance. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges