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 JimmyJJeeter · Apr 23, 2012 at 09:44 PM · buildcustomfilesfolder

A way copy my extra files to the Build?

I have some files which are not normal resources. Like odd file extensions (not txt or jpg etc.). I want to make sure they get copied to the 'data' folder when the game gets built. I was hoping I could just put them in Resources or Plugins but that's not working. Can I do this easily, or do I need to write a custom editor script to build and copy?

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 numberkruncher · May 10, 2012 at 11:39 PM 0
Share

UIToolkit overcomes this limitation by forcing the developer to rename odd file extensions to .txt so that they are included in the build. Your custom loading scripts can then load the file and use it as desired. I do not know if this is appropriate for you, but it certainly works for them.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by JimmyJJeeter · Aug 23, 2012 at 06:44 PM

Well 3.5.2 gave me just what I needed: http://docs.unity3d.com/Documentation/ScriptReference/PostProcessBuildAttribute.html

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 numberkruncher · Aug 23, 2012 at 07:44 PM 0
Share

Wow, very useful! thanks :)

avatar image
0

Answer by Bunny83 · Apr 23, 2012 at 09:58 PM

Unfortunately there is no delegate or callback when the building process has finished (at least non that i know).

You can however use a Perl script that is executed after the build. See PostprocessBuildPlayer

edit If you have Unity pro i guess it should be possible to just write an editorscript which creates the build manually. See BuildPipeline

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 JimmyJJeeter · Apr 23, 2012 at 10:06 PM 0
Share

Thanks for the link. Perl!? Does it have to be Perl?

avatar image Bunny83 · Apr 23, 2012 at 10:19 PM 0
Share

Well, I'm not sure. It's not really documented ;) I haven't used it yet...

If there are really that many files you have to copy you could also create a batchfile you just have to run. It could also start the build afterwards ;)

Another way could be to create some kind of sym-link in the data folder so your extra files are mapped into the folder. Never tried something like that. $$anonymous$$aybe this doesn't work.

avatar image JimmyJJeeter · Apr 24, 2012 at 07:24 PM 0
Share

Good ideas, thanks. It would have to copy after the build, because the build clears the folders of these extra files, hence the problem. If it would just overwrite but not delete files in the build folder, it would be ok.

avatar image Bunny83 · Apr 24, 2012 at 07:36 PM 0
Share

What kind of extra files are you talking about? Since they aren't registrated in Unity's assetdatabase you could simply add them to a different folder? Btw: are you talking about a standalone build or a webbuild?

For standalone build you could have just a second folder with your "external stuff" right beside the exe and the data folder

avatar image JimmyJJeeter · May 10, 2012 at 09:02 PM 0
Share

It's standalone, files are .pcx, .txt, and some others. I didn't know Unity would find them outside the data path, can that be relative? like Application.dataPath + "..\\externals" ??

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Loading scenes from folder? 3 Answers

Get raw script of a Unity component 2 Answers

Unity freezes when building a project - when Building Resources Folder 3 Answers

Unbuild / Extract files from build 4 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