Search Unity

“Unity实验室” 是一个新系列的Blog文章,主要介绍目前在实验中,但是未来可能会出现的Unity功能。

在第一篇的”Unity实验室”的博客中,我们探讨一下关于开发者自定义发布设置的功能。目的是让开发者可以针对不同的发布平台进行自定义设置,这样就可以做到不同项目发布到不同平台时候,可以有各自不同的设定。

该方法允许在同一个平台下自定义多个不同的发布设置,例如发布到iOS平台,我们可以自定义一个iPhone的设置以及一个iPad的设置。或者是一个桌面系统(PC版)的设置或者是Steam专用版本设置等等。这并非官方给定的选项,而是开发者可以自己命名和设定的,而且可以无限增加。

左边是目前版本的发布设置界面,右边是在实验阶段的新发布设置界面。

自定义发布设置功能支持继承,一个项目的发布配置可以从其他项目的发布设置继承过来,而且只会把我们新修改的发布设置项覆盖掉。

这意味着以后我们可以自定义一些大方向的基础设置,例如一个用于所有触摸机器的设置。相关属性设置一次后,以后只需要从这个设置继承过去,再稍微做点调整就可以使用了。

自定义发布设置可以针对特定平台(例如iOS),也可以是抽象的。为了让继承规则简单,只有抽象的规则才会有自定义发布设置。

每个自定义发布设置都可以指定单独的播放器设置,因此播放器设置将会在自定义发布设置中,而不是在平台里面。以后也会把播放器设置界面包含在发布界面中。

发布窗口永远都会有一个按钮,用来打开播放器设置。新的发布窗口把他们按合适的逻辑步骤直接包含在同一个窗口中。新的发布窗口会用树型结构来显示发布设置,以此来取代原来的平台列表。并且每一个发布设置都会有发布设置(Bulid Settings)、播放器设置(Player Settings)、场景设置(Scenes)的标签页。比如播放器设置(Player Settings),在每一个发布设置中都可以重新设置(或着不重新设置)所包含的场景列表(Scene List)。

在当前的Unity里,可以针对不同平台来指定不同的纹理属性。比如纹理大小或者格式,可以按照需求在不同平台上使用不同的设置。虽然纹理重载目前尚未实现,但希望以后我们可以针对每个发布设置来定义这些纹理。这意味着即使在触摸设备的基础设置中设置为使用标清纹理,但仍允许基于它的iPad版本的发布设置中使用高清纹理。当然每个重载都是可调整的。

Unity允许通过代码来自定义某些特定平台,这是另外一个尚未成形但有强大潜力的功能。以后可能会实现开发者根据自己自定义的发布设置来编写一套代码来动态修改自己的配置。

在默认情况下,建立一个新工程时会自动生成一组发布设置。每个不同的平台都会继承自某个基础发布设置,而生成一个设置。这意味着工作流程还是像当前在Unity中一样简单,而且还可以很灵活(稍微复杂)设置发布设置,这个设置是可选的。

Unity 的开发者们,这样的发布设定对你来说,哪些功能是你想要的?哪些流程是可以简化你的工作量的?请及时通过微信或者微博、论坛与我们沟通,我们等待您们的反馈!

chinese sns

47 评论

订阅评论

评论被关闭。

  1. “To keep inheritance rules simple, only abstract build configurations can have child build configurations.”

    What’s simple about this, compared to just not having this arbitrary restriction?

    I like you to think again about this statement. What problem in which use case does this solve?

    If you don’t require this restriction, you not only get a simpler to understand system (less rules), you could also rename “abstract” to “hide in configuration UI” and be done with it. Even easier to understand what it really means.. ;)

    (Not all build system configurators are also programmers who have heard of abstract types)

  2. I’ll use it for building server scenes of the game, client scenes and other multiplayer/MMO related exes which need to be made.
    We usually have a lobby.exe, several server.exes for different parts and clients for different platforms.
    MS Build and custom coding saved us with the help of current build functionality in unity but it’s good to have something graphical like this.
    For almost all project we have custom build scripts.

  3. To make full use of asset pipeline customization it would also be great if the texture importer accepted compressed textures (PVRTC, DXT, ETC1, … and maybe the AFT format).

    It is a real handicap when all conversions are handled under the hood. It does not only limit us in the way we store and handle assets, it also limits us when trying to use other conversion related quality features like dithering or other channel processing options. We are e.g. splitting the alpha to a separate texture only when using ETC1 compression and we assemble other target platform specific textures with aux channels.

    The same applies to audio compression, like doing a volume normalize on a temp version of the original asset followed by the actual compression (maybe also done with a standalone tool) without modifying the actual source assets.

  4. I am quite interested in the Steam build. What is it? What does it do? Will this make it easier to make Steam games? So many questions…

    1. Rune Skovbo Johansen

      十月 7, 2014 10:41 上午

      There is no “Steam Build” built-in option, it’s just an example of a name you could give to a build configuration that you would use for builds intended for distribution through Steam.

  5. I like it :)
    But, “These are not built-in options to choose from; rather each build configuration is defined”. I strongly recommend to have “some basic” custom build options like “iPhone” , “iPad” , “Steam”, etc…

  6. What about batch building of a set of configs. So that you can set up an overnight build of all versions of an app (much like the cloud build does). I would like to set up a build server so that I can simply have it look at a directory and do a build of it at a set time each night, reporting any errors back to me via an email.

  7. PLEASE, DON’T FORGOT of this -> be able to include/remove scene files for a specific build configuration. it’s really ultra important!

    1. I agree! ALSO VERY IMPORTANT: Separate Assets Folders per configuration! My iPhone App may have smaller textures than my iPad app. My Amazon Marketplace version needs Amazon’s Game Circle libraries and is not allowed to include the google play libraries needed for my Google Play version (yet both are Android). Maybe my free version of the game has ads (and third party sdks to show them etc) but my paid version shouldn’t not include all that extra junk. Etc, etc.

  8. Alex Vanden Abeele

    十月 5, 2014 7:59 下午

    A step in the good direction, but before it is useful it indeed needs including/excluding assets.

    We use a custom build script that is executed by a build server, is the new build settings system equipped for headless builds?

    Also, we target the web player and build many asset bundles, I don’t see the tool helping out on that.

  9. Very nice! I have custom build scripts for almost every project I do now. It’ll be nice to have something built-in that I can use for my custom builds.

  10. For those of you who need some of these more advanced build features, please take note: As of today, Unity Cloud Build now supports:

    – making development / debug builds
    – using your own pre- and post-export methods
    – custom scripting defines
    – custom scene lists

    If you haven’t already, consider signing up for the beta: http://build.cloud.unity3d.com/

  11. People are doing this already, but with 3rd party scripts, it would be nice to have a more powerful builtin feature.
    First I`ll use it for development builds and live builds, then split by platform and input types.
    A nice addition will be to have other project settings like Input dependable by custom build.

  12. hi, Make Building to all platforms OS independent. It means I can build to all targets on windows or macos. Currently to build for IOS I must use macos, to build for win8 I must use Windows PC. it’s really bad.

    1. this is an Apple Requirement, not a Unity one. (Apple says “to dev for iOS, be an a Mac or get lost”)

  13. Definitely don’t drop it

  14. We have now like in one Unity Project more sub projects that we need to build. Current build workflow does not allow us to have multiple builds ouputs (different scenes for each project, different splash screen, different settings) With your prototype I can see it will be possible to have one Unity Project with different build projects ouput. Like one unity project can create more built apps. Thank you for this.

  15. PygmyMonkey Tools

    十月 3, 2014 11:44 上午

    Hello everyone,

    We’ve already created a custom build tool that does exactly that and more!
    It’s called Advanced Builder and is available right here: https://www.assetstore.unity3d.com/#!/content/13624

    PS: Thanks @Anomalusundrdog for the promo ;)

  16. David O'Donoghue

    十月 3, 2014 7:40 上午

    Please make sure you add Post and Pre editor scripts functions that we can tag with an attribute.

    I really need “pre” events to add compiler defines etc.

  17. I think this is a great idea.

    Also +1 to everything DIRK BIALLUCH said in his comment.

  18. As new build targets become available, the need for this feature grows.

    There are multiple Unite videos where the guys from Owlchemy Labs break down the need for this feature and how they accomplished this functionality internally.

    Until now, I was thinking that I’d have to roll my own solution. I really hope Unity provides a built-in mechanism for this.

    And integrating it with Unity Cloud Build would be even better.

  19. Awesome! We build a similar tool with editor scripts to deal with the different Android app stores (Amazon, Google Play, Ouya, Stores in China,…). Would be great to get all the Unity features with custom build configurations.

  20. Sounds great as a first foundation to support multiple target platforms within one project. We definitely need more:

    1. Ablilty to swap and exclude resources (textures, sounds, …) per target going down to the material level so we can also replace materials and the actual shaders used.

    2. Max texture size per target is not enough. We usually produce all graphics in HD and a per target/per texture downres factor would be more useful (1:1, half, quarter, …).

    3. That team license should be a standard Pro feature of Unity, not a separate option we have to pay for. Having to pay to prevent hours of asset conversion is lame, after buying multiple Pro licenses and each individual exporter. Per target asset caching and version control are must have features.

    1. Regarding point 2, have you looked into QualitySettings.masterTextureLimit?

  21. Please also include a setting that exclude certain files from a specific platform. This is useful for things like opening cutscene video, which different platform uses different video format. I wish to use .mp4 for android, .mov for iOS but I don’t want both the files to be included into the app as its too big in size. Would be great if able to exclude the .mp4 video file from iOS platform, and exclude .mov from android.

  22. Please integrate this into Unity. I have been mulling around ideas for an editor script to do this for a while now since it is critical for people targeting multiple stores under a specific platform. For example, Android builds can refer to low/mid/high performing phones, tablets, Amazon Fire TV, OUYA, GameStick … the list goes on and on and there have been many times where having specific defines for each platform would have saved me a ton of headaches and sped up my development. Also, the added benefit of having texture size overrides would be excellent in helping with keeping build sizes down on devices with more restricted hardware while not compromising the experience on higher performing hardware.

  23. Philippe Da Silva

    十月 2, 2014 6:57 下午

    Did I just saw on that screenshot a built-in Desktop Steam platform? *hint*

  24. Still not enough. We use custom build pipeline, as we need to exclude some resources from build e.g. by putting them to Editor folder and then return them back.

    That’s why this is still not the replacement for a custom build tool.

  25. This is just great! When it will be available?

    It will be very much useful if I can set my textures import settings per plataform (including mipmapping) .

  26. Please integrate this with Unity Cloud Build!

  27. Looks great. Combine this with a couple of additional build hooks (pre-build-starting, for example) and I’ll finally be able to have my team start using Unity’s build window again :)

  28. This would be awesome… similar to build configurations in Visual Studio. Configure each of your builds / environments and flip the switch before you build.

    We really need this in unity!

  29. This would be fantastic to have built into Unity, especially if it was fleshed out some more.

    For our Android build I’ve created a custom solution where the /Plugins/Android/ content is added during the build process, based on Preprocessor values. This means that I’m able to build with the correct plugins and AndroidManifest.xml that I need per platform, so I’m not using Amazon plugins and manifest data when building for Google (or even more exotic platforms that are even less compatible, where you need the switch the MAIN activity for example, so you have to use a different AndroidManifest file).

    It would be great to be able to have this level of control and functionality built in, go for it! ;)

  30. Our team has built something very similar to this and it has saved so much time and improved workflow. It would be fantastic to have this officially supported.

  31. Agree completely with @ANOMALUSUNDRDOG

    It would be really useful to have per-buildconfig Resources folders. This could even be done automatically based on folder name (ex /Resources-[BuildConfigName]/ or /Resources/[BuildConfigName]/). This is a very important feature that Unity is sorely missing right now.

    1. +1

  32. This is a much-needed addition. Please don’t lock this one under the Pro licenses! Architecture-based platforms really no longer apply to modern development, an “Android” build could be going to three or four different marketplaces for example, each with different requirements, sometimes vastly different – controller-based 10 Foot Experience unconsoles vs 5″ touch screens.

    As has been mentioned, to really work properly we need to be able to mark individual assets as belonging to different build configs. As it stands, we’re having to choose between bloated packages or manually maintaining multiple collections of assets.

  33. Could a custom build be a code only update for an existing build?

  34. I’d use it for sure. Custom defines would be sweet, e.g. for OUYA. This way my OUYA code would not be compiled when targeting other Android devices.

  35. Well, as now I can only think of Android where I would need something like that (OUYA and mobile build). But if other developers can use it for other platforms too it’s nice.

  36. Riley Labrecque

    十月 2, 2014 3:54 下午

    Excellent! As the creator of Steamworks .NET this is definitely something that I and my users have been wanting.

    The biggest thing that I would want from this is the build config defines that were mentioned.

  37. AnomalusUndrdog

    十月 2, 2014 3:52 下午

    Also a feature suggestion: be able to turn on/off certain Resources folders for a specific build configuration. Something like you can drag & drop which Resources folders you want added, or perhaps Unity looks for all Resources folders in your Assets folder and lets you check/uncheck which you want.

    Same with scenes: be able to include/remove scene files for a specific build configuration.

  38. AnomalusUndrdog

    十月 2, 2014 3:50 下午

    This was the reason I bought Advanced Builder on the Asset Store. Build-specific defines, replace the art assets with high-res versions for newer phones but of same platform, builds to be released specific to a particular digital store (Amazon Appstore, Samsung store, Google Play, et al), etc.

    Would love to see this in the official builds soon!

    1. PygmyMonkey Tools

      十月 3, 2014 11:45 上午

      Thanks for the promo mate ;)
      AdvancedBuilder is available right here for those interested: https://www.assetstore.unity3d.com/#!/content/13624