I want to detect when a change is made to player settings. Specifically, when the Unity user makes a change to the Android "Bundle Identifier", I want to call some Editor scripting code.
OnValidate() works with MonoBehaviours and ScriptableObjects:
https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnValidate.html
But PlayerSettings is a Unity Object:
public sealed class PlayerSettings : UnityEngine.Object {
I can make a Custom Inspector for PlayerSettings:
[CustomEditor(typeof(PlayerSettings))]
public class PlayerSettingsValidate : Editor {
public override void OnInspectorGUI() {
DrawDefaultInspector();
}
public void OnValidate() {
Debug.Log("You changed something");
}
}
But DrawDefaultInspector() does not work, nor does OnValidate().
**How can I detect when a change is made to a Player Settings value?**
↧