Search code examples
c#securityunity-game-engineprivate

Making a game - What is the advantage of the secure variables?


I have made Game in Unity , which contains lots of public and private varibles and functions. I wanted the game to be secure , so I bought Anti cheat toolkit from unity asset store https://www.assetstore.unity3d.com/en/#!/content/10395 .So my question is do i need secured private variables ? If yes, then what is the use of private variables? What advantages do they have (in security terms) ?


Solution

  • do I need to secure private variables ?

    No, both public and private variables have the same security defences (or rather no security defences). If an attacker can view or modify a public variable, they can view or modify a private variable.

    Access modifiers are there for programmer convenience and to help with architectural decisions.