1. Home
  2. Docs
  3. Asset Protection
  4. How to start

How to start

It is way to easy to access built Unity3D game Assets through common Asset unpacker.
You do not want your precious assets, created in a high consuming timeprocess, be found in other games?
Or you want to protect against cheating caused by asset editing? A wallhack needs only one replaced material.

But there is a way to fight against those!

Step 1:

Assets you wish to get protected have to be in a Resources folder.
(For example Assets\Resources\… or Assets\…\Resources).
Then select those assets and mark them in the Inspector as to get protected.

Supported Assets:

  • Prefabs
  • Materials
  • Textures
  • Audio
  • Texts/Bytes

Step 2:

To load protected Assets you have multiple options.

(1) Either you can define public fields and set the belonging asset through the inspector:

(Important note: If you replace in scripts a not protected fieldtype through a protected. For example: GameObject to ProtectedGameObject, you have to reasign the reference in the inspector!)

(2) Or you can load them in a script:

(3) Or you can use the ‘Protected Asset Loader’ behaviour to automatic set properties. (Important! You cannot set field values with the ‘Protected Asset Loader’, only properties.)

The Protected Asset Loader Behaviour can be added normally to GameObjects, like all other Behaviours.

After adding, you have to add a new row. Click the ‘+’ at the bottom.
In the new row, you can choose a component which property you want to set. In this example the ‘Skinnend Mesh Renderer’ is selected. After you chose the component, you can choose the property you want to set. Then select the protected asset. (This asset has to be in a Resources folder!)

The ‘Protected Asset Loader’ loads then the protected assets in its Awake method. So you can use the protected assets after the Awake calls.

Step 3:

Last but not least, you have to protect your marked assets.

To do this, go to Unity Window->Asset Protection.

Protect the assets, marked in step 1, for the chosen build target.

(Important note! You have to do this every time you mark new assets to get protected or modify some protected  one. Even if you press play in the editor you have to do the protection process!)