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 /
avatar image
0
Question by rlloyd518518 · Apr 25, 2017 at 05:59 PM · unity 5filescompiling

What is saved in the Game file when completed

Please dont be overly technical. Im still learning,

I am just learning Unity and thought I'd try something simple. I created a small village. No people. No actions. No combat. Just a walk around. When I save the file for someone else to look at, is this file going to be filled with extra code and files that arent being used? If so, is there a way to NOT have that happen?

Comment
Add comment · Show 6
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 tanoshimi · Apr 25, 2017 at 08:48 PM 0
Share

When you say "save the file for someone else to look at", do you mean them looking at the source files and scene in your Unity project? Or do you mean letting them play a compiled version of the game?

avatar image Vicarian tanoshimi · Apr 25, 2017 at 08:52 PM 0
Share

If it is the former, then my answer applies; however, if it's the latter then when building a compiled version of the game, Unity uses reference checking to automatically trim unused files from the resource files the build process generates. Your code will still be visible by anyone using a .NET decompiler, like ILSpy, but they won't get context on how the files are used. You may consider Obfuscation tools if you don't want others using your code.

avatar image tanoshimi Vicarian · Apr 25, 2017 at 09:04 PM 0
Share

It's generally agreed that obfuscation tools have little benefit - they certainly make debugging any problems found during development much harder, and they have quite significant risk of breaking callbacks that are referenced by name. You're generally correct about Unity only including assets that are referenced within the included scenes in a build - with the exception of any assets placed in the /resources folder, which are included regardless of whether they are used or not.

avatar image rlloyd518518 tanoshimi · Apr 25, 2017 at 11:53 PM 0
Share

I am referring to when I compile a game. Im hoping that if I build something simple, that the compiled game isnt huge due to extraneous libraries and code that I didnt use.

avatar image tanoshimi rlloyd518518 · Apr 26, 2017 at 07:47 AM 0
Share

No, it won't be. Assu$$anonymous$$g you haven't placed any resources from the /resources folder, the only assets included in the build will be those models, textures, animations and sounds actually used in the included scenes. (you can check this by exa$$anonymous$$ing the editor log after making a build - it will show you exactly what assets were included).

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Vicarian · Apr 25, 2017 at 08:00 PM

Generally, when you deploy (distribute) a Unity project, you may omit the Libraries folder and the Visual Studio solution (*.sln) file. This folder and associated Visual Studio files are rebuilt automatically on loading Unity. A good way to distribute a full Unity project is to package it using Assets > Export Package... then select all your files in the window that appears. Unity will generate an archive for you with all your files for someone to then import into a new project.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Moving file failed 2 Answers

Hide certain game files? 1 Answer

Unity 5 _ Game freezes on play when any script is added to the project. 0 Answers

Unity3D crash after launching. 0 Answers

Strange Files Replacing My Game Files? 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