Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by shadowpuppet · May 06, 2017 at 07:24 PM · public variableadvice

not a question, just advice on public variables

public variables are great for when you are tweaking and easier, at times, then typing in GameObject.find etc etc. but the downside to not having them hard wired into the code is that you can loose them. I had a script whose name didn't match the class name so unity didn't load it, nor a few other scripts that referenced it. even after repairing the typo suddenly ALL - I mean EVERY SINGLE public variable was lost!. I mean dozens of scripts with as many as a dozen variables each. I spent two days reading every script trying to find out what I was suppose to drag into that slot. And while I was at it , I hard coded much of what I couldalt text

gone.jpg (133.5 kB)
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 Hatsuko · Oct 26, 2017 at 09:41 PM 0
Share

Hi. I just randomly come across this post and I just want to say, you can try using version control. It will solve this problem :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by shadowpuppet · Oct 27, 2017 at 01:17 AM

what is version control?

Comment
Add comment · Show 1 · 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 Hatsuko · Oct 27, 2017 at 02:23 AM 0
Share

I can't explain it well so I'll just give you article I found. You can google for more.

http://makegamessa.com/discussion/811/tutorial-version-control-in-unity-using-mercurial-source-tree-and-bitbucket

  • Version control is an efficient, sometimes elegant way to keep track of your project's history.

  • It works like a time machine that you can use to fetch versions of files (code, images, whatever you're keeping track of) from the past.

  • It also let's you work on your project with a group of people a lot more efficiently than passing around individual files.

So basically if you are using version control, you are... 1. Using a software (there are a lot of options, Git, SVN, Hg...) 2. This software keeps track of your project's history (Every time after you modify your project, you "commit" the changes you made. This results in a revision. You'll have lots of revisions. You can resume your project to whatever revision, like a time machine.)

So I can imagine that once you find there's something wrong with your project, you just resume it. For example public variable values are serialized with scenes. If all your references are gone, you can try to revert your scene files.

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

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

Assets advice 0 Answers

public variable gameobject 0 Answers

Inputting another scripts variable as a float 1 Answer

What do you use MouseButtonDown and MouseButtonUp for? 0 Answers

Unity 4.1.5 is not showing certain public variables in the inspector 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