//
        // Get convolution rendering settings.
        //
        static public ConvolutionOption GetConvolutionOption()
        {
            CustomPhononSettings customSettings = FindObjectOfType <CustomPhononSettings>();

            if (customSettings)
            {
                return(customSettings.convolutionOption);
            }

            return(ConvolutionOption.Phonon);
        }
        //
        // Get Ray tracing option.
        //
        static public SceneType GetRayTracerOption()
        {
            CustomPhononSettings customSettings = FindObjectOfType <CustomPhononSettings>();

            if (customSettings)
            {
                return(customSettings.rayTracerOption);
            }

            return(SceneType.Phonon);
        }
        // Returns Convolution Option.
        // Safe to call this function without Initialize being called on Phonon Manager.
        public ConvolutionOption ConvolutionOption()
        {
            CustomPhononSettings customSettings = CustomPhononSettings();

            if (customSettings)
            {
                return(customSettings.convolutionOption);
            }

            return(Phonon.ConvolutionOption.Phonon);
        }
        // Returns Scene Type.
        // Safe to call this function without Initialize being called on Phonon Manager.
        public SceneType RayTracerOption()
        {
            CustomPhononSettings customSettings = CustomPhononSettings();

            if (customSettings)
            {
                return(customSettings.rayTracerOption);
            }

            return(SceneType.Phonon);
        }
        //
        // Get compute device settings.
        //
        static public ComputeDeviceType GetComputeDeviceSettings(out int numComputeUnits, out bool useOpenCL)
        {
            CustomPhononSettings customSettings = FindObjectOfType <CustomPhononSettings>();

            if (customSettings)
            {
                numComputeUnits = customSettings.numComputeUnits;
                useOpenCL       = customSettings.useOpenCL;
                return(customSettings.computeDeviceOption);
            }

            numComputeUnits = 0;
            useOpenCL       = false;
            return(ComputeDeviceType.CPU);
        }
        // Returns Compute Device Type.
        // Safe to call this function without Initialize being called on Phonon Manager.
        public ComputeDeviceType ComputeDeviceSettings(out int numComputeUnits, out bool useOpenCL)
        {
            CustomPhononSettings customSettings = CustomPhononSettings();

            if (customSettings && customSettings.convolutionOption == Phonon.ConvolutionOption.TrueAudioNext)
            {
                numComputeUnits = customSettings.numComputeUnits;
                useOpenCL       = true;
                return(ComputeDeviceType.GPU);
            }

            numComputeUnits = 0;
            useOpenCL       = false;
            return(ComputeDeviceType.CPU);
        }
        //
        // Draws the inspector.
        //
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            PhononGUI.SectionHeader("Simulation Setting");
            serializedObject.FindProperty("rayTracerOption").enumValueIndex = EditorGUILayout.Popup("Raytracer Options", serializedObject.FindProperty("rayTracerOption").enumValueIndex, optionsRayTracer);

            PhononGUI.SectionHeader("Renderer Setting");
            serializedObject.FindProperty("convolutionOption").enumValueIndex = EditorGUILayout.Popup("Convolution Options", serializedObject.FindProperty("convolutionOption").enumValueIndex, optionsConvolution);

            CustomPhononSettings customSettings = serializedObject.targetObject as CustomPhononSettings;

            if (customSettings.convolutionOption == ConvolutionOption.TrueAudioNext)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("numComputeUnits"));
            }

            EditorGUILayout.HelpBox("This is an experimental feature. Please contact the developers to get relevant documentation to use Custom Phonon Settings feature.", MessageType.Info);
            serializedObject.ApplyModifiedProperties();
        }