Quantcast
Channel: Latest Questions by Selzier
Viewing all articles
Browse latest Browse all 34

Editor Scripting: How To Detect a Change in Player Settings

$
0
0
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?**

Viewing all articles
Browse latest Browse all 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>