Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Catlard · Nov 14, 2013 at 03:45 AM · importexportpackagesupdating

Importing new versions of packages?

My team uses a set of tools we created -- and it's on version 1.71. People on my team import it into their different projects via a package. But just now I've added a super helpful, awesome tool that everyone using this package should use. In it, I've got some changes to old scripts, and some new stuff that needs to be linked into the old stuff.

The problem is this -- when they import the new version of the same package, it seems to import the new versions of the old scripts in addition to the old ones -- but I'd rather they just be replaced, as long as they're in the original toolset's folder structure. Is there a way to have this happen? Right now, whenever someone tries to update their version of the tools, it causes things to become unlinked, creates duplicate versions of files, etc etc. Does giving my package the same name as before do anything to change this? For example, if I try to import a file called "Tools v1" and then import "Tools v2" there will probably be an issue. But if I am always just importing a package named "Tools", then does that change anything?

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
5
Best Answer

Answer by Catlard · Nov 21, 2013 at 02:20 AM

So, I ran some experiments myself. For the purposes of this project, I created a package with one script, tool.cs. I attempted to import it into a project with different names (changing the contents of the cs file in the second version), and with the same names, and with variables assigned in the inspector, and putting the script in different folders.

My conclusion is that the name of the package itself is irrelevant. The important thing is the name of the files. There are a few gotchas, as I suspected:

  1. If you replace a file of the same name, regardless of location, the variables are reset, even though there was no change in the prefab. This could be useful for resetting packages by reimporting them, but for updating existing packages (where the user customized the contents of the package), this could be dangerous. My suggestion is that there be a popup window that asks you if you want to retain your old values on scripts/prefabs x, y, and z seperately.

  2. Instead of duplicating scripts in different locations, Unity will keep a folder structure, but replace a script of the same name in its original location, with no warning. So if you have a bunch of scripts in one folder, but then you move them to another folder in another package, they won't be in the new folder. They'll be modified in the original one.

So, this makes my plan of having a continually updating toolset more difficult, principally because any modification to a "module" in my toolset, or any use of any customizable tool by another user will be overridden by the default values, when the user re-imports the package. For me, this is a negative thing.

Here are the results of my experiments, by the way:

 1) New project + tool_1.unitypackage
 + tool_2.unitypackage (script modified) = correctly replaced
 tools.cs script.
 
 2) New project + tool.unitypackage +
 tool.unitypackage (script modified)
 = correctly replaced tools.cs script.
 
 3) New project + tools.unitypackage
 (then assign a Texture2D in the
 inspector) + tools.unitypackage
 (modified variable name for texture)
 = correctly replaced prefab and script, but the value texture
 variable with the changed name gets
 replaced with the value of the new
 package.
 
 4) New project + tools.unitypackage
 (assign a Texture2D in the
 inspector) + tools.unitypackage
 (modified tools.cs and prefab placed
 in a new folder) = No warning, but
 the old files are replaced, and the
 new folder (with the same scripts)
 appears and is empty.
 
 5) New project + tools.unitypackage
 (assign a Texture2D in the
 inspector) + the exact same package
 = Texture value reset to original, even though there was no change to the script where the variable itself existed.

 
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

16 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

Related Questions

Import package has wrong contents 0 Answers

Blender to Unity Export missing large parts of mesh. 1 Answer

Exporting animated scene from Blender to Unity 0 Answers

My scene disappeared after import package standard package, HELP! 0 Answers

Blender Path animation to Unity? 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