UnityEditor.AudioUtil.GetListenerPos C# (CSharp) Method

GetListenerPos() private method

private GetListenerPos ( ) : Vector3
return Vector3
        public static extern Vector3 GetListenerPos();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]

Usage Example

示例#1
0
        private void OnEnable()
        {
            this.m_AudioClip             = base.serializedObject.FindProperty("m_audioClip");
            this.m_PlayOnAwake           = base.serializedObject.FindProperty("m_PlayOnAwake");
            this.m_Volume                = base.serializedObject.FindProperty("m_Volume");
            this.m_Pitch                 = base.serializedObject.FindProperty("m_Pitch");
            this.m_Loop                  = base.serializedObject.FindProperty("Loop");
            this.m_Mute                  = base.serializedObject.FindProperty("Mute");
            this.m_Spatialize            = base.serializedObject.FindProperty("Spatialize");
            this.m_SpatializePostEffects = base.serializedObject.FindProperty("SpatializePostEffects");
            this.m_Priority              = base.serializedObject.FindProperty("Priority");
            this.m_DopplerLevel          = base.serializedObject.FindProperty("DopplerLevel");
            this.m_MinDistance           = base.serializedObject.FindProperty("MinDistance");
            this.m_MaxDistance           = base.serializedObject.FindProperty("MaxDistance");
            this.m_Pan2D                 = base.serializedObject.FindProperty("Pan2D");
            this.m_RolloffMode           = base.serializedObject.FindProperty("rolloffMode");
            this.m_BypassEffects         = base.serializedObject.FindProperty("BypassEffects");
            this.m_BypassListenerEffects = base.serializedObject.FindProperty("BypassListenerEffects");
            this.m_BypassReverbZones     = base.serializedObject.FindProperty("BypassReverbZones");
            this.m_OutputAudioMixerGroup = base.serializedObject.FindProperty("OutputAudioMixerGroup");
            this.m_AudioCurves           = new AudioSourceInspector.AudioCurveWrapper[]
            {
                new AudioSourceInspector.AudioCurveWrapper(AudioSourceInspector.AudioCurveType.Volume, "Volume", 0, AudioSourceInspector.kRolloffCurveColor, base.serializedObject.FindProperty("rolloffCustomCurve"), 0f, 1f),
                new AudioSourceInspector.AudioCurveWrapper(AudioSourceInspector.AudioCurveType.SpatialBlend, "Spatial Blend", 1, AudioSourceInspector.kSpatialCurveColor, base.serializedObject.FindProperty("panLevelCustomCurve"), 0f, 1f),
                new AudioSourceInspector.AudioCurveWrapper(AudioSourceInspector.AudioCurveType.Spread, "Spread", 2, AudioSourceInspector.kSpreadCurveColor, base.serializedObject.FindProperty("spreadCustomCurve"), 0f, 1f),
                new AudioSourceInspector.AudioCurveWrapper(AudioSourceInspector.AudioCurveType.Lowpass, "Low-Pass", 3, AudioSourceInspector.kLowPassCurveColor, null, 0f, 1f),
                new AudioSourceInspector.AudioCurveWrapper(AudioSourceInspector.AudioCurveType.ReverbZoneMix, "Reverb Zone Mix", 4, AudioSourceInspector.kReverbZoneMixCurveColor, base.serializedObject.FindProperty("reverbZoneMixCustomCurve"), 0f, 1.1f)
            };
            AudioSourceInspector.m_CurveEditorSettings.hRangeMin = 0f;
            AudioSourceInspector.m_CurveEditorSettings.vRangeMin = 0f;
            AudioSourceInspector.m_CurveEditorSettings.vRangeMax = 1.1f;
            AudioSourceInspector.m_CurveEditorSettings.hRangeMax = 1f;
            AudioSourceInspector.m_CurveEditorSettings.vSlider   = false;
            AudioSourceInspector.m_CurveEditorSettings.hSlider   = false;
            TickStyle tickStyle = new TickStyle();

            tickStyle.tickColor.color = new Color(0f, 0f, 0f, 0.15f);
            tickStyle.distLabel       = 30;
            AudioSourceInspector.m_CurveEditorSettings.hTickStyle = tickStyle;
            TickStyle tickStyle2 = new TickStyle();

            tickStyle2.tickColor.color = new Color(0f, 0f, 0f, 0.15f);
            tickStyle2.distLabel       = 20;
            AudioSourceInspector.m_CurveEditorSettings.vTickStyle        = tickStyle2;
            AudioSourceInspector.m_CurveEditorSettings.undoRedoSelection = true;
            this.m_CurveEditor          = new CurveEditor(new Rect(0f, 0f, 1000f, 100f), new CurveWrapper[0], false);
            this.m_CurveEditor.settings = AudioSourceInspector.m_CurveEditorSettings;
            this.m_CurveEditor.margin   = 25f;
            this.m_CurveEditor.SetShownHRangeInsideMargins(0f, 1f);
            this.m_CurveEditor.SetShownVRangeInsideMargins(0f, 1.1f);
            this.m_CurveEditor.ignoreScrollWheelUntilClicked = true;
            this.m_LastSourcePosition   = this.GetSourcePos(base.target);
            this.m_LastListenerPosition = AudioUtil.GetListenerPos();
            EditorApplication.update    = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.Update));
            Undo.undoRedoPerformed      = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
            this.m_Expanded3D           = EditorPrefs.GetBool("AudioSourceExpanded3D", this.m_Expanded3D);
        }
All Usage Examples Of UnityEditor.AudioUtil::GetListenerPos