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
5
Question by StephanK · Aug 03, 2011 at 09:27 AM · buildxcoderesourcesassembly

Only recompile scripts instead of full build?

Is there a way to only recompile scripts instead of rebuilding the whole project? E.g. if I have setup my whole game and I only want to insert a Debug.Log or similar it is really annoying to have to rebuild the whole project.

Would it be possible to use MonoDevelop to do the compilation and then replace an assembly in an .apk for example?

I still haven't found a solution for this. I am looking for a way to either change/update the C-Sharp Assembly or the resources.asset in an XCode project to avoid doing full rebuilds if no assets were changed between two builds. I tried doing a build without the resources folder and then insert the resources.asset from a previous build manually, but if I do so Unity can't find the assets from resources, so I guess there's something else happening at build time. :(

Comment
Add comment · Show 3
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 roamcel · Sep 01, 2011 at 05:41 AM 0
Share

This is a good question indeed when your projects reach a certain size. Would like to know an answer to it myself.

avatar image nathanfrost0x · Oct 30, 2013 at 10:31 PM 0
Share

I'm surprised that in the 2+ years that have elapsed since this question was asked that incremental building of a standalone .exe or "Published Build" (or even just recompiling code without touching any other assets of an already-built standalone exe) is still not supported by Unity.

This is a major problem on my current project, because: a) Unity Editor performance is drastically, unplayably worse than standalone exe performance (eg solid 60fps for a standalone exe, and 1-10fps in-Editor) b) at least two instances of the (networked) game are necessary to play (a client and a server) c) it takes 40-45 seconds to build our simplest test scene into a standalone exe (a full production level is much longer)

Thus, for most tests -- even after the simplest one line change -- I have a $$anonymous$$imum of a 40 second turnaround, when simply rebuilding the code takes 1-3 seconds. (The designers have to wait several $$anonymous$$utes per iteration!)

Still no word on this?

avatar image yoyo · Dec 08, 2015 at 01:19 AM 0
Share

http://docs.unity3d.com/ScriptReference/BuildOptions.BuildScriptsOnly.html seems like just the thing, but rumour has it that it doesn't actually work.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by nathanfrost0x · Mar 08, 2014 at 12:33 AM

On Windows, we've been copying Assembly-CSharp.dll and Assembly-CSharp.dll.mdb successfully for several weeks. For us it's more than ten times faster than rebuilding the whole project.

While I haven't tested the approach on OSX, I'd love to know if it works in that environment!

You do need to specially handle the UNITY_EDITOR #define to make the .dll compatible between the editor and the built player.

More details:

http://answers.unity3d.com/questions/627511/remove-unity-editor-define-even-for-in-editor-buil.html#answer-658285

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
avatar image
0

Answer by Bunny83 · Dec 11, 2012 at 11:43 AM

There's not much you can do about that. xcode have to crosscompile anyways. If it's just for debugging, you could implement a plugin interface and try to load an external assembly. This assembly can be changed

Comment
Add comment · Show 3 · 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 StephanK · Dec 11, 2012 at 11:56 AM 0
Share

I thought ios does not allow external assemblies to be loaded during runtime? I don't $$anonymous$$d the xcode compilation process, it's the building of the resources folder that is so annoying...

avatar image Bunny83 · Dec 11, 2012 at 12:03 PM 0
Share

Yes, that's right, iOS doesn't support reflection since it's AOT compiled. Do you just worry about an iOS project? That's not very clear in your question.

Personally i never tried to do something like that with xcode. Unity compiles the code into Arm assembler code which is then build by xcode. I'm not sure if you can trigger the compiling process for the code manually.

avatar image StephanK · Dec 11, 2012 at 12:11 PM 0
Share

$$anonymous$$y original question is over a year old and back then I was working on an Android project, but now I have the same problem on ios, so ins$$anonymous$$d of creating a duplicate I just edited the original question. But I am looking for a platform independent solution that will allow me to make builds without rebuilding the assets everytime.

avatar image
0

Answer by Wolfram · Aug 04, 2017 at 11:17 AM

Just for reference: Since Unity 2017.1, there is now an option in the build settings to do exactly that.

Comment
Add comment · Show 4 · 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 draber · Mar 12, 2018 at 07:49 PM 1
Share

Quick side note on this - we found that while this option does work, Unity blows away the Data/Raw folder under your iOS build during the process, which is where our Bundles from the Strea$$anonymous$$gAssets folder go. We found success copying that folder to a temporary location and copying it back after calling BuildPlayer.

avatar image Wolfram · Oct 09, 2018 at 10:31 AM 0
Share

Another Update: They are currently in the process of reworking the whole AssetBundle system. The new system "Addressable Assets" can be teste from 2018.2 onward:

https://forum.unity.com/threads/addressables-are-here.536304/

https://docs.unity3d.com/Packages/com.unity.addressables@0.3/manual/index.html

avatar image Bunny83 Wolfram · Oct 09, 2018 at 01:40 PM 0
Share

While addressable assets sounds quite useful, i don't think that this covers scripts just like AssetBundles can't contain scripts. You can put scripts into seperate assemblies which could be inlucded as pure binary data in an assetbundle and loaded through reflection. However script / code that is loaded this way has several restrictions when it comes to referencing the classes defined in such an assembly. Also dynamic loading of assemblies usually doesn't work on AoT platforms. So the main issue remains. Assemblies are not assets in the sense of Unity. A script from the assetdatabase point of view is just a TextAsset ($$anonymous$$onoScript) which is an editor only asset type. At runtime this asset type doesn't exist.

avatar image Wolfram Bunny83 · Oct 09, 2018 at 03:25 PM 0
Share

You are absolutely right, of course. $$anonymous$$y thinking (which I didn't make clear) was more along the lines of "You can perhaps alleviate the problem and speedup build times if you use Addressable Assets to have as many assets as possible make use of the Addressable Assets System, so that a normal Build will not re-process them unnecessarily."

avatar image
0

Answer by xuanyusong · Oct 09, 2018 at 09:22 AM

  AssetDatabase.ImportAsset(AssetDatabase.GUIDToAssetPath(AssetDatabase.FindAssets("t:Script")[0]));
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 Bunny83 · Oct 09, 2018 at 09:38 AM 0
Share

How does this make you're not required to rebuild your project? All you do is reimporting the first script it finds which makes no sense at all.

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

10 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

Related Questions

Distribute terrain in zones 3 Answers

pathname slash/backslash 1 Answer

WebGl build throw numbers (maybe assembly pointers) 0 Answers

Xcode build & run "innocent" (?) problem 0 Answers

How do I change bundle identifier for autogenerated Unity-iPhone Tests-Info.plist 0 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