When I tired to build my game it gave me these errors:
Assets/Plugins/PlayerPrefsPlugin/Editor/PlayerPrefsPro.cs(52,52): error CS0103: The name `PlayerSettings’ does not exist in the current context
Assets/Plugins/PlayerPrefsPlugin/Editor/PlayerPrefsPro.cs(92,100): error CS0103: The name `PlayerSettings’ does not exist in the current context
I think the problem is with my Unity libraries (or something). Would rebuilding/importing them somehow fix this?
PlayerSettings needs "using UnityEditor" to work. And you need to remove everything linked to the editor within your build using #if UNITY_EDITOR using UnityEditor; #endif ... #if UNITY_EDITOR PlayerSettings... #endif
PlayerSettings is in UnityEditor module, which is not available in builds. You need to use platform dependent compilation for the code that wants to use PlayerSettings, so that it is not used for builds.
Basically add before the first use of PlayerSettings add #if UNITY_EDITOR and when it is not used add #endif. But make sure that your logic is nicely separated and that you don’t use any variables from the conditionally compiled block.
Btw, PlayerSettings contains data about how the application (the “Player”) will be built, it has nothing to do with the human user, also called “player”.
PlayerSettings needs "using UnityEditor" to work. And you need to remove everything linked to the editor within your build using #if UNITY_EDITOR using UnityEditor; #endif ... #if UNITY_EDITOR PlayerSettings... #endif
– ABerlemont