- Updated screen shots for manual
- added reset button when settings appear corrupted
This commit is contained in:
Родитель
1e74f97338
Коммит
685304fd69
Двоичные данные
docs/images/recorder-menu.png
Двоичные данные
docs/images/recorder-menu.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 30 KiB После Ширина: | Высота: | Размер: 16 KiB |
|
@ -75,8 +75,12 @@ namespace UnityEditor.FrameRecorder
|
|||
{
|
||||
var path = AssetDatabase.GUIDToAssetPath(candidates[0]);
|
||||
m_WindowSettingsAsset = AssetDatabase.LoadAssetAtPath<RecorderWindowSettings>(path);
|
||||
if (m_WindowSettingsAsset == null)
|
||||
{
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
}
|
||||
}
|
||||
else
|
||||
if(m_WindowSettingsAsset == null)
|
||||
{
|
||||
m_WindowSettingsAsset = ScriptableObject.CreateInstance<RecorderWindowSettings>();
|
||||
AssetDatabase.CreateAsset(m_WindowSettingsAsset, "Assets/FrameRecordingSettings.asset");
|
||||
|
@ -114,7 +118,6 @@ namespace UnityEditor.FrameRecorder
|
|||
}
|
||||
catch (ExitGUIException)
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -127,10 +130,31 @@ namespace UnityEditor.FrameRecorder
|
|||
}
|
||||
catch (Exception) {}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox("An exception was raised while editing the settings. This can be indicative of corrupted settings.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Reset settings to default"))
|
||||
{
|
||||
ResetSettings();
|
||||
}
|
||||
}
|
||||
Debug.LogException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
void ResetSettings()
|
||||
{
|
||||
UnityHelpers.Destroy(m_Editor);
|
||||
m_Editor = null;
|
||||
m_recorderSelector = null;
|
||||
var path = AssetDatabase.GetAssetPath(m_WindowSettingsAsset);
|
||||
UnityHelpers.Destroy(m_WindowSettingsAsset, true);
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
AssetDatabase.Refresh(ImportAssetOptions.Default);
|
||||
m_WindowSettingsAsset = null;
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
StopRecording();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.FrameRecorder;
|
||||
using UnityEngine.FrameRecorder.Timeline;
|
||||
using UnityEngine.Timeline;
|
||||
|
@ -18,45 +20,68 @@ namespace UnityEditor.FrameRecorder.Timeline
|
|||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
// Bug? work arround: on Stop play, Enable is not called.
|
||||
if (m_Editor != null && m_Editor.target == null)
|
||||
try
|
||||
{
|
||||
UnityHelpers.Destroy(m_Editor);
|
||||
m_Editor = null;
|
||||
m_recorderSelector = null;
|
||||
}
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
if (m_recorderSelector == null)
|
||||
{
|
||||
m_recorderSelector = new RecorderSelector( OnRecorderSelected, false );
|
||||
m_recorderSelector.Init((target as RecorderClip).m_Settings);
|
||||
}
|
||||
|
||||
m_recorderSelector.OnGui();
|
||||
|
||||
if (m_Editor != null)
|
||||
{
|
||||
m_Editor.showBounds = false;
|
||||
m_Timeline = FindTimelineAsset();
|
||||
|
||||
PushTimelineIntoRecorder();
|
||||
|
||||
using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
|
||||
// Bug? work arround: on Stop play, Enable is not called.
|
||||
if (m_Editor != null && m_Editor.target == null)
|
||||
{
|
||||
EditorGUILayout.Separator();
|
||||
UnityHelpers.Destroy(m_Editor);
|
||||
m_Editor = null;
|
||||
m_recorderSelector = null;
|
||||
}
|
||||
|
||||
m_Editor.OnInspectorGUI();
|
||||
if (m_recorderSelector == null)
|
||||
{
|
||||
m_recorderSelector = new RecorderSelector(OnRecorderSelected, false);
|
||||
m_recorderSelector.Init((target as RecorderClip).m_Settings);
|
||||
}
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
m_recorderSelector.OnGui();
|
||||
|
||||
PushRecorderIntoTimeline();
|
||||
if (m_Editor != null)
|
||||
{
|
||||
m_Editor.showBounds = false;
|
||||
m_Timeline = FindTimelineAsset();
|
||||
|
||||
serializedObject.Update();
|
||||
PushTimelineIntoRecorder();
|
||||
|
||||
using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
|
||||
{
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
m_Editor.OnInspectorGUI();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
PushRecorderIntoTimeline();
|
||||
|
||||
serializedObject.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ExitGUIException)
|
||||
{
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EditorGUILayout.HelpBox("An exception was raised while editing the settings. This can be indicative of corrupted settings.", MessageType.Warning);
|
||||
|
||||
if (GUILayout.Button("Reset settings to default"))
|
||||
ResetSettings();
|
||||
|
||||
Debug.LogException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
void ResetSettings()
|
||||
{
|
||||
UnityHelpers.Destroy(m_Editor);
|
||||
m_Editor = null;
|
||||
m_recorderSelector = null;
|
||||
UnityHelpers.Destroy((target as RecorderClip).m_Settings, true);
|
||||
}
|
||||
|
||||
public void OnRecorderSelected()
|
||||
|
|
Загрузка…
Ссылка в новой задаче