Define what happens if an cheater or hacker got detected. Open for this your programming environment. Create an Detector class. The best is to create an MonoBehaviour and add it to your first scene too.
Either you can use the Anti Cheat Auto Protection to protect your game, by activating the auto protection under ‘Window->Anti Cheat Settings’ or you can surely do it by yourself.
Step 4 (Continue for custom protection):
Here you see an example of how to use protected fields. Protected fields protect your game against memory cheating through softwares like Cheat Engine.
Step 5 (Continue for custom protection):
The Protected fields support most operators. So you can for example calculate with an ProtectedInt32 like you used to with Int32.
Step 6 (Continue for custom protection):
If you want to protect user settings, you can use the ProtectedPlayerPrefs. They can be used exactly the same like Unitys PlayerPrefs.
Step 7 (Continue for custom protection):
Speeding protection is an important component! ProtectedTime uses the cpu clock to calculate an not modifyable gamespeed.