How do you manage your Free and Paid Android/iOS game(C#)


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 ( )

  • 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;          
     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( )

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 :wink:

Thank you very much

Florent Valdelievre

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.