public void OnEnable(SerializedObject serializedObject)
        {
            this.m_WidthMultiplier    = serializedObject.FindProperty("m_Parameters.widthMultiplier");
            this.m_WidthCurve         = serializedObject.FindProperty("m_Parameters.widthCurve");
            this.m_Settings.hRangeMin = 0f;
            this.m_Settings.vRangeMin = 0f;
            this.m_Settings.vRangeMax = 1f;
            this.m_Settings.hRangeMax = 1f;
            this.m_Settings.vSlider   = false;
            this.m_Settings.hSlider   = false;
            TickStyle tickStyle = new TickStyle();

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

            tickStyle2.tickColor.color        = new Color(0f, 0f, 0f, 0.15f);
            tickStyle2.distLabel              = 20;
            this.m_Settings.vTickStyle        = tickStyle2;
            this.m_Settings.undoRedoSelection = true;
            this.m_Editor          = new CurveEditor(new Rect(0f, 0f, 1000f, 100f), new CurveWrapper[0], false);
            this.m_Editor.settings = this.m_Settings;
            this.m_Editor.margin   = 25f;
            this.m_Editor.SetShownHRangeInsideMargins(0f, 1f);
            this.m_Editor.SetShownVRangeInsideMargins(0f, 1f);
            this.m_Editor.ignoreScrollWheelUntilClicked = true;
            Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
        }
        public ClipCurveEditor(CurveDataSource dataSource, TimelineWindow parentWindow)
        {
            this.m_DataSource  = dataSource;
            this.m_CurveEditor = new CurveEditor(new Rect(0f, 0f, 1000f, 100f), new CurveWrapper[0], false);
            ClipCurveEditor.s_CurveEditorSettings.set_hSlider(false);
            ClipCurveEditor.s_CurveEditorSettings.set_vSlider(false);
            ClipCurveEditor.s_CurveEditorSettings.set_hRangeLocked(false);
            ClipCurveEditor.s_CurveEditorSettings.set_vRangeLocked(false);
            ClipCurveEditor.s_CurveEditorSettings.set_scaleWithWindow(true);
            ClipCurveEditor.s_CurveEditorSettings.set_hRangeMin(0f);
            ClipCurveEditor.s_CurveEditorSettings.showAxisLabels            = true;
            ClipCurveEditor.s_CurveEditorSettings.allowDeleteLastKeyInCurve = true;
            ClipCurveEditor.s_CurveEditorSettings.rectangleToolFlags        = 0;
            CurveEditorSettings arg_F9_0  = ClipCurveEditor.s_CurveEditorSettings;
            TickStyle           tickStyle = new TickStyle();

            tickStyle.tickColor.set_color(DirectorStyles.Instance.customSkin.colorInlineCurveVerticalLines);
            tickStyle.distLabel = 20;
            tickStyle.stubs     = true;
            arg_F9_0.set_vTickStyle(tickStyle);
            CurveEditorSettings arg_135_0 = ClipCurveEditor.s_CurveEditorSettings;

            tickStyle = new TickStyle();
            tickStyle.tickColor.set_color(new Color(0f, 0f, 0f, 0f));
            tickStyle.distLabel = 0;
            arg_135_0.set_hTickStyle(tickStyle);
            this.m_CurveEditor.set_settings(ClipCurveEditor.s_CurveEditorSettings);
            this.m_CurveEditor.set_shownArea(new Rect(1f, 1f, 1f, 1f));
            this.m_CurveEditor.set_ignoreScrollWheelUntilClicked(true);
            this.m_CurveEditor.curvesUpdated = new CurveEditor.CallbackFunction(this.OnCurvesUpdated);
            this.m_BindingHierarchy          = new BindingSelector(parentWindow, this.m_CurveEditor);
        }
        public void OnEnable(SerializedObject serializedObject)
        {
            m_WidthMultiplier = serializedObject.FindProperty("m_Parameters.widthMultiplier");
            m_WidthCurve      = serializedObject.FindProperty("m_Parameters.widthCurve");

            m_Settings.hRangeMin = 0.0f;
            m_Settings.vRangeMin = 0.0f;
            m_Settings.vRangeMax = 1.0f;
            m_Settings.hRangeMax = 1.0f;
            m_Settings.vSlider   = false;
            m_Settings.hSlider   = false;

            TickStyle hTS = new TickStyle();

            hTS.tickColor.color   = new Color(0.0f, 0.0f, 0.0f, 0.15f);
            hTS.distLabel         = 30;
            m_Settings.hTickStyle = hTS;
            TickStyle vTS = new TickStyle();

            vTS.tickColor.color   = new Color(0.0f, 0.0f, 0.0f, 0.15f);
            vTS.distLabel         = 20;
            m_Settings.vTickStyle = vTS;

            m_Settings.undoRedoSelection = true;

            m_Editor          = new CurveEditor(new Rect(0, 0, 1000, 100), new CurveWrapper[0], false);
            m_Editor.settings = m_Settings;
            m_Editor.margin   = 25;
            m_Editor.SetShownHRangeInsideMargins(0.0f, 1.0f);
            m_Editor.SetShownVRangeInsideMargins(0.0f, 1.0f);
            m_Editor.ignoreScrollWheelUntilClicked = true;

            Undo.undoRedoPerformed += UndoRedoPerformed;
        }
 public void OnEnable(SerializedObject serializedObject)
 {
     this.m_WidthMultiplier = serializedObject.FindProperty("m_Parameters.widthMultiplier");
     this.m_WidthCurve = serializedObject.FindProperty("m_Parameters.widthCurve");
     this.m_Settings.hRangeMin = 0f;
     this.m_Settings.vRangeMin = 0f;
     this.m_Settings.vRangeMax = 1f;
     this.m_Settings.hRangeMax = 1f;
     this.m_Settings.vSlider = false;
     this.m_Settings.hSlider = false;
     TickStyle style = new TickStyle {
         tickColor = { color = new Color(0f, 0f, 0f, 0.15f) },
         distLabel = 30
     };
     this.m_Settings.hTickStyle = style;
     TickStyle style2 = new TickStyle {
         tickColor = { color = new Color(0f, 0f, 0f, 0.15f) },
         distLabel = 20
     };
     this.m_Settings.vTickStyle = style2;
     this.m_Settings.undoRedoSelection = true;
     this.m_Editor = new CurveEditor(new Rect(0f, 0f, 1000f, 100f), new CurveWrapper[0], false);
     this.m_Editor.settings = this.m_Settings;
     this.m_Editor.margin = 25f;
     this.m_Editor.SetShownHRangeInsideMargins(0f, 1f);
     this.m_Editor.SetShownVRangeInsideMargins(0f, 1f);
     this.m_Editor.ignoreScrollWheelUntilClicked = true;
     Undo.undoRedoPerformed = (Undo.UndoRedoCallback) Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
 }
Beispiel #5
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);
        }
 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_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 AudioCurveWrapper[] { new AudioCurveWrapper(AudioCurveType.Volume, "Volume", 0, kRolloffCurveColor, base.serializedObject.FindProperty("rolloffCustomCurve"), 0f, 1f), new AudioCurveWrapper(AudioCurveType.SpatialBlend, "Spatial Blend", 1, kSpatialCurveColor, base.serializedObject.FindProperty("panLevelCustomCurve"), 0f, 1f), new AudioCurveWrapper(AudioCurveType.Spread, "Spread", 2, kSpreadCurveColor, base.serializedObject.FindProperty("spreadCustomCurve"), 0f, 1f), new AudioCurveWrapper(AudioCurveType.Lowpass, "Low-Pass", 3, kLowPassCurveColor, null, 0f, 1f), new AudioCurveWrapper(AudioCurveType.ReverbZoneMix, "Reverb Zone Mix", 4, kReverbZoneMixCurveColor, base.serializedObject.FindProperty("reverbZoneMixCustomCurve"), 0f, 1.1f) };
     m_CurveEditorSettings.hRangeMin = 0f;
     m_CurveEditorSettings.vRangeMin = 0f;
     m_CurveEditorSettings.vRangeMax = 1.1f;
     m_CurveEditorSettings.hRangeMax = 1f;
     m_CurveEditorSettings.vSlider = false;
     m_CurveEditorSettings.hSlider = false;
     TickStyle style = new TickStyle {
         color = new Color(0f, 0f, 0f, 0.15f),
         distLabel = 30
     };
     m_CurveEditorSettings.hTickStyle = style;
     TickStyle style2 = new TickStyle {
         color = new Color(0f, 0f, 0f, 0.15f),
         distLabel = 20
     };
     m_CurveEditorSettings.vTickStyle = style2;
     this.m_CurveEditor = new CurveEditor(new Rect(0f, 0f, 1000f, 100f), new CurveWrapper[0], false);
     this.m_CurveEditor.settings = 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_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);
 }
Beispiel #7
0
        void OnEnable()
        {
            m_AudioClip             = serializedObject.FindProperty("m_audioClip");
            m_PlayOnAwake           = serializedObject.FindProperty("m_PlayOnAwake");
            m_Volume                = serializedObject.FindProperty("m_Volume");
            m_Pitch                 = serializedObject.FindProperty("m_Pitch");
            m_Loop                  = serializedObject.FindProperty("Loop");
            m_Mute                  = serializedObject.FindProperty("Mute");
            m_Spatialize            = serializedObject.FindProperty("Spatialize");
            m_SpatializePostEffects = serializedObject.FindProperty("SpatializePostEffects");
            m_Priority              = serializedObject.FindProperty("Priority");
            m_DopplerLevel          = serializedObject.FindProperty("DopplerLevel");
            m_MinDistance           = serializedObject.FindProperty("MinDistance");
            m_MaxDistance           = serializedObject.FindProperty("MaxDistance");
            m_Pan2D                 = serializedObject.FindProperty("Pan2D");
            m_RolloffMode           = serializedObject.FindProperty("rolloffMode");
            m_BypassEffects         = serializedObject.FindProperty("BypassEffects");
            m_BypassListenerEffects = serializedObject.FindProperty("BypassListenerEffects");
            m_BypassReverbZones     = serializedObject.FindProperty("BypassReverbZones");
            m_OutputAudioMixerGroup = serializedObject.FindProperty("OutputAudioMixerGroup");

            m_AudioCurves = new AudioCurveWrapper[]
            {
                new AudioCurveWrapper(AudioCurveType.Volume, "Volume", kRolloffCurveID, kRolloffCurveColor, serializedObject.FindProperty("rolloffCustomCurve"), 0, 1),
                new AudioCurveWrapper(AudioCurveType.SpatialBlend, "Spatial Blend", kSpatialBlendCurveID, kSpatialCurveColor, serializedObject.FindProperty("panLevelCustomCurve"), 0, 1),
                new AudioCurveWrapper(AudioCurveType.Spread, "Spread", kSpreadCurveID, kSpreadCurveColor, serializedObject.FindProperty("spreadCustomCurve"), 0, 1),
                new AudioCurveWrapper(AudioCurveType.Lowpass, "Low-Pass", kLowPassCurveID, kLowPassCurveColor, null, 0, 1),
                new AudioCurveWrapper(AudioCurveType.ReverbZoneMix, "Reverb Zone Mix", kReverbZoneMixCurveID, kReverbZoneMixCurveColor, serializedObject.FindProperty("reverbZoneMixCustomCurve"), 0, 1.1f)
            };

            m_CurveEditorSettings.hRangeMin = 0.0f;
            m_CurveEditorSettings.vRangeMin = 0.0f;
            m_CurveEditorSettings.vRangeMax = 1.1f;
            m_CurveEditorSettings.hRangeMax = 1.0f;
            m_CurveEditorSettings.vSlider   = false;
            m_CurveEditorSettings.hSlider   = false;

            TickStyle hTS = new TickStyle();

            hTS.tickColor.color = new Color(0.0f, 0.0f, 0.0f, 0.15f);
            hTS.distLabel       = 30;
            m_CurveEditorSettings.hTickStyle = hTS;
            TickStyle vTS = new TickStyle();

            vTS.tickColor.color = new Color(0.0f, 0.0f, 0.0f, 0.15f);
            vTS.distLabel       = 20;
            m_CurveEditorSettings.vTickStyle = vTS;

            m_CurveEditorSettings.undoRedoSelection = true;

            m_CurveEditor          = new CurveEditor(new Rect(0, 0, 1000, 100), new CurveWrapper[0], false);
            m_CurveEditor.settings = m_CurveEditorSettings;
            m_CurveEditor.margin   = 25;
            m_CurveEditor.SetShownHRangeInsideMargins(0.0f, 1.0f);
            m_CurveEditor.SetShownVRangeInsideMargins(0.0f, 1.1f);
            m_CurveEditor.ignoreScrollWheelUntilClicked = true;

            m_LastSourcePosition      = GetSourcePos(target);
            m_LastListenerPosition    = AudioUtil.GetListenerPos();
            EditorApplication.update += Update;

            m_Expanded3D = EditorPrefs.GetBool("AudioSourceExpanded3D", m_Expanded3D);
        }