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
1
Question by oriolmanya · Oct 17, 2012 at 12:02 PM · prefabinstancevalueapply

Protect a value from Apply

I need a way to protect some concrete public values of prefab's instances from Apply.

Example: I have a soldier (An instance from a Prefab) with many modified values exposed on the inspector such as:

  • Health

  • Waypoints Array

  • Speed

Each soldier comes from the same Prefab but each one has different values on these variables.

Let's suppose that I want to change the material, or the mesh, or add some component or some child object.

After doing the changes, when I click "Apply" all the values of my soldiers will be the same than the soldier from I "Applied" the changes.

I discovered that interesting possible solution in the forum:

http://answers.unity3d.com/questions/135886/apply-prefab-except-for-one-component.html

But it's not perfect, since It's mandatory to do little changes to all the values of the class even if you don't want to have a different value from the original, what it's really annoying.

Is there another way to protect a especific value from the powerful but dangerous "Apply"?

Comment
Add comment · Show 1
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 ModLunar · Apr 29, 2018 at 07:31 PM 0
Share

Years later and I still would really love an answer to this. I was hoping there could be a C# attribute you could just be like [IgnorePrefabApply] or something on the field(s) you want to ignore applying to the prefab!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by SharkoFR · Apr 29, 2018 at 08:07 PM

hi! you can change variable like int, bool, float on just 1 soldier but the material or the mesh is the same for all which means if you change only 1 material on 1 soldier, it apply it on all. if you think i don't understand your question, can you send screenshot and more explain please.

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

11 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

Related Questions

How to do not apply fields in prefab 1 Answer

Apply Changes to Prefab - Unity 2018 0 Answers

Changing the Variables of An Instanced Script 2 Answers

The value is not reset for prefab. 2 Answers

How to refer to a collision between clones of the same prefab? C# 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