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 May 19, 2016 at 04:09 PM by Fr0stbite for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Fr0stbite · Jul 17, 2013 at 10:38 AM · gameobjectscenefind

How Can i Find all gameobject in All scene

I want to make an option menu and make a toggle specular and etc. But i need to apply the settings for all gameobject in all scene.

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

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by sfc.itzhak · Jul 17, 2013 at 12:07 PM

to get all GameObjects

   public   GameObject[] AllGo;
     // Use this for initialization
     void Start () {
       AllGo=  GameObject.FindObjectsOfType(typeof(GameObject)) as GameObject[];
       foreach (GameObject go in AllGo)
       {
           go.SendMessage("message");
 
       }
     }
Comment
Add comment · Show 6 · 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 Fr0stbite · Jul 17, 2013 at 12:22 PM 0
Share

is this script get all gameobject in all scene?

avatar image sfc.itzhak · Jul 17, 2013 at 02:38 PM 0
Share

this gets all Gameobjects in the scene yes

avatar image Fr0stbite · Jul 17, 2013 at 04:50 PM 0
Share

But only in the current scene.I want to know how can i change every gameobject in the ALL scnenes

avatar image sfc.itzhak · Jul 17, 2013 at 06:04 PM 0
Share

you cant; you need to save the data onta a gameobject that isnt destroyed on load DontDestroyOnLoad http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html

then on scene load you invoke a function that dose the above on all GameObjects.

good Luck Sfc

avatar image Fr0stbite · Jul 18, 2013 at 07:26 AM 0
Share

thank you!

Show more comments
avatar image
0

Answer by ZBLau · May 17, 2016 at 04:16 AM

Transform[] arrTransforms = Resources.FindObjectsOfTypeAll().Where((s) => (s.hideFlags == HideFlags.None)).ToArray();

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

Follow this Question

Answers Answers and Comments

17 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

Related Questions

Access gameObject between multi-scene 0 Answers

Alternatives to GameObject.Find(); 1 Answer

Finding Children question 3 Answers

Find all gameObjects with same tag 1 Answer

Urgent please. Can't Find Scene in build settings while scene is in build settings. 0 Answers


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