Setup and Use

Once imported into your project, AccessEntitlement is very simple and intuitive to use.

Opening AccessEntitlement

Select “Tools/Akiba/Access Entitlement” in the Unity Editor window. This will open up the main AccessEntitlement window.

Selecting a Build Platform

Within the AccessEntitlement window, you will see 6 main build platform categories, represented by buttons containing the icons for the respective platforms. Clicking each of these buttons will set the AccessEntitlement symbols list to display only the entitlement symbols for the selected platform.

The build platforms within AccessEntitlement are directly representative of those within the Build Settings window.

Due to a lack of access to development licenses, not all of these platforms have been tested, but should work without any issues.

Currently, the only platforms supported are:

  • Windows, MacOS, Linux
  • Android
  • iOS
  • PS4 (untested)
  • Xbox One (untested)
  • Switch (untested)

Setting Up a New Symbol

Click the “Add New Symbol” button to add a new entitlement symbol to the window.

A new entitlement symbol will now be visible in the window under “Access Entitlement Symbols”.

This new list item contains the following attributes:

  • ID – The symbols position in the list
  • Name – the public name of the symbol used in code (MUST not contain spaces)
  • Is Enabled – Whether the code encapsulated within this symbol is accessible
  • Buttons
    • – Provides information on how to use the symbol in code
    • – Moves the symbol up in the list
    • – Removes the symbol
    • – Moves the symbol down in the list

Give your symbol a meaningful name in the Name attribute, this can be anything like “GAME_FULLVER”, “GAME_DEMO”, “GAME_COLLECTORS” etc, but must not contain any spaces, only basic characters, numbers, hyphens, and underscores.

Tick the Is Enabled toggle, and click “Save” to both save these changes in the window, and add the entitlement symbols to the Build Settings defined compilation symbols.

Your new symbol should now be visible in “Project Settings/Player/Other Settings/Script Compilation/Scripting Define Symbols”.

Using Your Symbol(s)

Your newly defined entitlement symbol can now be used in your code anywhere in your project by using preprocessor directives.

Simply encapsulate your desired code (code or features requiring restricted access entitlement) with a preprocessor directive in order to control whether that code is compiled during build using the “Is Enabled” option shown in Setting Up a New Symbol.

The total supported directives are:

  • #if – A standard if statement
  • #elif – An elseif statement
  • #else – An else statement
  • #endif – The end of the statement

These statements can be inverted by using a “!” not declaration before the symbol name.

Build!

From here, you can create individual builds for your different game versions by simply opening up AccessEntitlement, enabling/disabling the relevant symbols, clicking save, then build to an executable.

No more messing around with multiple projects, or different scenes for every version build.