public static void AddObject()
 {
     if (GameObject.FindObjectOfType <AdsMasterSettingLoader>() == null)
     {
         GameObject gameObj = new GameObject();
         gameObj.name = "AdsMaster Loader";
         var loader = gameObj.AddComponent <AdsMasterSettingLoader>();
         loader.settings = LibResourceUtil.LoadAndCreateSetting <AdsMasterSetting>();
         EditorSceneManager.MarkAllScenesDirty();
     }
 }
        public override void OnInspectorGUI()
        {
            GUI.changed = false;

            EditorGUI.BeginChangeCheck();
            Loader.settings = EditorGUILayout.ObjectField("Settings", Loader.settings, typeof(AdsMasterSetting), false) as AdsMasterSetting;
            if (Loader.settings == null)
            {
                Loader.settings = LibResourceUtil.LoadAndCreateSetting <AdsMasterSetting>();
                GUI.changed     = true;
            }

            if (GUILayout.Button("Edit Settings"))
            {
                AdsMasterEditor.OpenSettings();
            }
            EditorGUI.EndChangeCheck();

            if (GUI.changed)
            {
                EditorSceneManager.MarkAllScenesDirty();
            }
        }