public void OnRecorderSelected()
        {
            var clip = this.target as RecorderClip;

            if (m_Editor != null)
            {
                UnityHelpers.Destroy(m_Editor);
                m_Editor = null;
            }

            if (m_recorderSelector.selectedRecorder == null)
            {
                return;
            }

            if (clip.m_Settings != null && RecordersInventory.GetRecorderInfo(m_recorderSelector.selectedRecorder).settings != clip.m_Settings.GetType())
            {
                UnityHelpers.Destroy(clip.m_Settings, true);
                clip.m_Settings = null;
            }

            if (clip.m_Settings == null)
            {
                clip.m_Settings = RecordersInventory.GenerateNewSettingsAsset(clip, m_recorderSelector.selectedRecorder);
            }
            m_Editor = Editor.CreateEditor(clip.m_Settings) as RecorderEditor;
            AssetDatabase.Refresh();
        }
Esempio n. 2
0
        public void OnRecorderSelected()
        {
            if (m_Editor != null)
            {
                UnityHelpers.Destroy(m_Editor);
                m_Editor = null;
            }

            if (m_recorderSelector.selectedRecorder == null)
            {
                return;
            }

            if (m_WindowSettingsAsset.m_Settings != null && RecordersInventory.GetRecorderInfo(m_recorderSelector.selectedRecorder).settings != m_WindowSettingsAsset.m_Settings.GetType())
            {
                UnityHelpers.Destroy(m_WindowSettingsAsset.m_Settings, true);
                m_WindowSettingsAsset.m_Settings = null;
            }

            if (m_WindowSettingsAsset.m_Settings == null)
            {
                m_WindowSettingsAsset.m_Settings = RecordersInventory.GenerateNewSettingsAsset(m_WindowSettingsAsset, m_recorderSelector.selectedRecorder);
            }
            m_Editor = Editor.CreateEditor(m_WindowSettingsAsset.m_Settings) as RecorderEditor;
            AssetDatabase.Refresh();
        }