- Home /
Easiest way to do Pro vs. Free or Lite versions of game?
I want to set up my Pro and Lite versions so they require as few changes as possible. I don't want to have to edit the code or remove objects if at all possible.
Ideally, let's say, for Ads I could just check the Bundle ID at run time and decide not to start the ads up. Is that possible? Anyone have better suggestions?
Not entirely sure what you want to achieve here... Pro and Free versions of your game? Does it have to do with Unity3D Pro and Unity3D Free? You don't have to make a game for "pro" and for "free", unless you want to share your unity project with people. Any customers will be able to play your game even if it was made in Pro.
I think he is referring to iOS. A free demo version and a Paid full version.
Answer by _Petroz · Mar 28, 2011 at 02:01 AM
If you are using C# you can maintain two separate versions with slightly different code using preprocessor directives. This is not only easy, it's also low-maintence which is the most important thing when branching an application into two versions.
Here is an example using #if #else and #endif
#define LITE true
void Start() { #if LITE // Less health in LITE version playerHealth = 50; #else playerHealth = 100; #endif }
void Update() { #if !LITE // health regen playerHealth += 5 * Time.deltaTime; #endif }
When you want to build a LITE version set
#define LITE true
When you want to build a PRO version set
#define LITE false
I was hoping maybe there was some way built into Unity to test. Like I mentioned, maybe the Bundle ID was available. This looks like the best bet. Thanks.
Answer by Justin Warner · Mar 27, 2011 at 05:43 PM
I think you mean like, in the Apple app stores, they have the Lite version, and the Full version. So you have like, the version with all the features, and a version with specialized things, such as no ads, maybe more money to start off with, etc.
So really, you'd just code the free version first. Then save that as the "Lite" version, then you add in/take out what you don't want for the "Pro" version. Is this what you mean? I mean, it's common sense, and differs depending on what kind of game it is and what you deem to be appropriate and what not.
Comment and I can help more, but good luck!
Answer by DaveA · Mar 27, 2011 at 08:17 PM
Is this what you mean: http://answers.unity3d.com/questions/17077/how-to-tell-indie-from-pro
If you mean a paid version vs free version (ad supported) of Your app, yeah, you can build in a boolean or something that says which version it is, then check it in various places in your code where you want to disable the paid features. you can deactivate gameobjects, scripts, whatever, enable adds, different GUI's whatever. This assumes you have two different builds of it. If you want one app that gets 'activated' online, that's a different kettle of fish. I'm thinking of putting such a solution on the Asset Store.