Beispiel #1
0
        private static void ExecuteBy()
        {
            if (!m_editorDialog.OpenYesNo("Project Settings で設定されているシーンの Global Illumination を無効化しますか?"))
            {
                return;
            }

            var settings = AllSceneGlobalIlluminationDisablerSettings.Load();

            SceneProcessor.ProcessAllScenes
            (
                scenePathFilter: scenePath => settings.ScenePathFilter.Any(x => scenePath.StartsWith(x)),
                onProcess: OnProcess
            );

            m_editorDialog.OpenOk("Project Settings で設定されているシーンの Global Illumination を無効化しました");
        }
        /// <summary>
        /// GUI を描画する時に呼び出されます
        /// </summary>
        public override void OnGUI(string searchContext)
        {
            if (m_settings == null)
            {
                m_settings = AllSceneGlobalIlluminationDisablerSettings.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();
                    AllSceneGlobalIlluminationDisablerSettings.Save();
                }
            }
        }
 //================================================================================
 // 関数(static)
 //================================================================================
 /// <summary>
 /// 設定を ProjectSettings フォルダから読み込みます
 /// </summary>
 internal static AllSceneGlobalIlluminationDisablerSettings Load()
 {
     return(m_instance = ScriptableObjectToJsonFileConverter.Load(PATH, m_instance));
 }