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 /
avatar image
0
Question by Starbox · Jun 15, 2015 at 06:04 PM · prefabfileinstancereadparameter

How (and where) does Unity save the modified parameters of a prefab's instance?

I am using a prefab (say a piece of environment, like a mesh) with some specific behaviour (it has a script as a component attached to it).

Said script contains several variables, preset by default, and many of them accessible in the Editor's inspector, for rapid tweaking. This way, the prefab is sufficiently modular. Now, I produce ten instances of that prefab in a scene by dragging the prefab in the 3D view. Then, I modify some of the values of these instances in the Inspector (tick some cases, change public vars like floats or ints). Not all instances are modified the same way, for the sake of variety. All overriden parameters now appear bolded.

I save the scene. Build for mobile, etc. During runtime, at the beginning, the game will produce a pool of those instances and will manage to retrieve then place each instance as I had put and saved them in the project's scene, with the specific modified parameters. So far so good.

Unity uses a system so as to know, when loading (activating) each instance individually, how to modify them according to my earlier choices.

Now, I'm unsure how nor where Unity saves the data specifically relevant to these overriding parameters. Is it saved in a single global file that can't be reached in the Editor? Is that file attached to the project as a whole, or is it divided into several files, one per scene or per prefab specifically? Or does Unity even produce more of them, one for each instance? What is the way to access and read this or these file(s)?

TL;DR: how does Unity store the list of all instances' modified parameters that will be read later on in game when recreating my scene?

Thx

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DiegoSLTS · Jun 15, 2015 at 06:23 PM

I guess that info is stored in the scene file itself, the .unity file of the scene you're editing.

If you use version control you can easily see that the only file that's modified when you change some of those values is the .unity file.

"How" are the stored? Well... you'll have to understand the .unity file format, you can open the file as text but it's not a file intended for human readers.

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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Two Instances of same Prefab dealing damage to each other. 0 Answers

Save and load prefabs instantiated at runtime 0 Answers

How do I re-link an object that has unintentionally become detached from prefab? 0 Answers

Script uses transform.position of Prefab instead of Instance 1 Answer

How can I read data from a text file, putting a large amount of data into structures 2 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