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 /
  • Help Room /
avatar image
0
Question by MarcoTTC · Dec 05, 2016 at 02:39 PM · projectapicompilingswitchingpreprocessor

How do I compile different builds of the same project using compile flags in Unity?

Hello, I'm somewhat new to Unity development. While I have already played around and developed a few, basic short games of my own, I haven't developed a long time project on Unity yet. So, I would like to know how do I develop different builds from the same project using compiling flags on Unity? I have seen some answers, but they are fragmented and do not give me a complete and satisfactory answer. I'll give some examples of what I mean:

Ex 1: I want to develop a WebGL game using external microtransaction and achievement APIs like Kongregate and Armor Games. How do I develop the project so I can compile a Kongregate version or a Armor Games version whenever I like, using the same assets and code? I know of C# preprocessor directives of course, I have already used them on my job many times, but I'm wondering if I would have to use them together with some sort of Unity Editor Scripts, and how that would work.

Ex 2: I want to develop a full game and a demo from the same project. The demo is going to have only 2 levels, the full game is going to have 10. How do I switch from one to another at the click of a button, like I do for the platform to be used? Should I use C# preprocessor directives again? It doesn't look pratical to rewrite one line each time I want to compile my code.

Ex 3: I have develop my game using Unity Ads, but for some reason, I can't publish it on a story while using Unity Ads, instead I have to use the store ads system. Is there any pratical way I can change it without having to rewrite C# preprocessor directive each time?

My questions aren't about platform dependency compilation, instead they are more about third party library compilation into an Unity project. How is the best way to solve that problem?

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

0 Replies

· Add your reply
  • Sort: 

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

79 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 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 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 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 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

Compiling Scipts shows and then Unity crashes. 0 Answers

Unity freezes when "compiling assembly definitions files scripts" while creating a new project 0 Answers

i can't find the gui textures tab 0 Answers

Help me I lost my project! 0 Answers

why cant i get into my project without the unity bug reporter stopping me 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