- Home /
How do you manage your Free and Paid Android/iOS game(C#)
Hello,
I was wondering how do you manage your Unity3D project when you have a Free and Paid game in term of code maintenance as well as buids.
1. Code Maintenance
Free Version ( com.game.freeversion )
I would limit the free version to the first 15 Levels and have the other one locked. I was thinking to define a preprocessor block like
#define LITE ... #if LITE freeVersion = true; #endif if(freeVersion) { ... }
As far as i understood, when you have '#define LITE' in the code(at the top of the source), LITE is implicitly set to TRUE. If not defined, it is FALSE. As a consequence, to build my lite version of the project i need to add this line dynamically, maybe with an 'ant' task before compiling the project, which i find really painful
Pro Version( com.game.paidversion )
2. Build
If i want to build both projects in one shot, i guess i would need to have unity3D Pro and play around BuildPipeline.BuildPlayer to manipulate the packagename + set the correct #define in my code.
Do you mind sharing your experiences ? Maybe there is an easy way ;)
Thank you very much
Florent Valdelievre
Answer by mindlube · Sep 13, 2012 at 05:12 AM
Florent, I can't speak to #2, although I have Pro license, just find #define to be easier. the problem is you have to #define at the top of every script. So you may need global defines plugin from prime31
edit Nov 10 2012: In Unity4, this global define functionality is built-in to the editor: In PlayerSettings | Per-Platform | Other Settings | Configuration : Scripting Define Symbols.
Thanks for that, It looks like we need to reimport the project each time we change the global define which might be long on my project, but its an alternative yes. Since i want to build for Android + Ios for LITE and PRO version, it means i would need 4 differents build. I will need to find an automatic way to do it though since i don't want do it through the editor.
Your answer
Follow this Question
Related Questions
Am i able to export to android with 30 day pro ? 3 Answers
Huge iOS Build 1 Answer
Why is there no "Render outside safe area" setting for iOS? 0 Answers
Build stripping and scenes in Asset Bundles 1 Answer
Distribute terrain in zones 3 Answers