private static void ExecuteBy() { if (!m_editorDialog.OpenYesNo("Project Settings で設定されているシーンの Skybox Material を null にしますか?")) { return; } var settings = AllSceneSkyboxMaterialRemoverSettings.Load(); SceneProcessor.ProcessAllScenes ( scenePathFilter: scenePath => settings.ScenePathFilter.Any(x => scenePath.StartsWith(x)), onProcess: OnProcess ); m_editorDialog.OpenOk("Project Settings で設定されているシーンの Skybox Material を null にしました"); }
/// <summary> /// GUI を描画する時に呼び出されます /// </summary> public override void OnGUI(string searchContext) { if (m_settings == null) { m_settings = AllSceneSkyboxMaterialRemoverSettings.Load(); } var serializedObject = new SerializedObject(m_settings); var scenePathFilterProperty = serializedObject.FindProperty("m_scenePathFilter"); using (var checkScope = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.PropertyField(scenePathFilterProperty); if (checkScope.changed) { serializedObject.ApplyModifiedProperties(); AllSceneSkyboxMaterialRemoverSettings.Save(); } } }
//================================================================================ // 関数(static) //================================================================================ /// <summary> /// 設定を ProjectSettings フォルダから読み込みます /// </summary> internal static AllSceneSkyboxMaterialRemoverSettings Load() { return(m_instance = ScriptableObjectToJsonFileConverter.Load(PATH, m_instance)); }