/

Recommended Protections for Unity

Shield provides specialized protection for Unity games, automatically adapting to both Mono and IL2CPP compilation modes.


Core Protections

These protections are essential for Unity games and have minimal performance impact:

{
  "protections": {
    "rename": {
      "rename_public": false,
      "rename_arguments": true
    },
    "constants_encryption": {},
    "constants_mutation": {}
  }
}

Shield automatically handles Unity compatibility for these protections, ensuring they don't interfere with the Unity engine or your game's functionality.


Advanced Protections

These protections can be added based on your specific needs:

{
  "protections": {
    "control_flow_advance": {
      "intensity": 6
    },
    "virtualization": {}
  }
}

When using these advanced protections:

  • Apply Control Flow only to critical game logic methods
  • Test Virtualization thoroughly with IL2CPP compilation
  • Monitor performance impact, especially on mobile devices

Protection Strategy by Game Component

Game Logic

Protect your core game mechanics and business logic:

  • Use Constants Encryption for sensitive values
  • Apply Control Flow to critical algorithms
  • Use Virtualization for important game systems

Monetization Systems

Secure your payment and premium content systems:

  • Constants Encryption for purchase validation
  • Control Flow for payment processing
  • Memory protection for virtual currency

Anti-Cheat Systems

Implement robust anti-cheat measures:

  • Memory protection
  • Runtime integrity checks
  • State validation

Performance Impact

Each protection has different performance implications:

ProtectionImpactNotes
RenamerNoneNo runtime overhead
Constants EncryptionMinimalSmall overhead on string decryption
Constants MutationMinimalSmall overhead on value access
Control FlowVariableApply selectively to critical methods
VirtualizationModerateTest thoroughly with IL2CPP

Best Practices

  1. Start with core protections and add advanced ones gradually
  2. Test thoroughly on all target platforms
  3. Monitor performance impact, especially frame rate
  4. Use selective protection for performance-critical code
  5. Verify compatibility with your Unity version and compilation mode

Shield automatically adapts its protections to work with Unity's environment. No special configuration is needed - Shield detects the Unity context and applies appropriate protections.

For known limitations, see Known Limitations.

Previous
Best Practices