Step 1: AntiCheat Prefab
Add the OPS\AntiCheat\Prefabs\AntiCheat.prefab to your first game scene.
Step 2: Detector
Every protected field contains a hidden field, showing its unprotected value in memory.
If a cheater tried to modify this value, it will not affect the game, but you can catch him because you
know the correct value.
You can attach an delegate getting called when a field hack is detected.
1 2 3 4 5 6 7 8 |
private void Awake() { FieldHackDetector.OnFieldCheatDetected += FieldCheatDetector_OnFieldCheatDetected; } private void FieldCheatDetector_OnFieldCheatDetected() { Text.text = "Field Hack Detected! Cheater tried to modify memory!"; } |