forked from unity3d-jp/FrameCapturer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
351 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
FrameCapturer/Assets/UTJ/FrameCapturer/Editor/RecorderBaseEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace UTJ.FrameCapturer | ||
{ | ||
public class RecorderBaseEditor : Editor | ||
{ | ||
public virtual void CommonConfig() | ||
{ | ||
var so = serializedObject; | ||
EditorGUILayout.PropertyField(so.FindProperty("m_outputDir"), true); | ||
EditorGUILayout.PropertyField(so.FindProperty("m_encoderConfigs"), true); | ||
} | ||
|
||
public virtual void RecordingControl() | ||
{ | ||
var recorder = target as RecorderBase; | ||
var so = serializedObject; | ||
|
||
// capture control | ||
EditorGUILayout.PropertyField(so.FindProperty("m_captureControl")); | ||
EditorGUI.indentLevel++; | ||
if (recorder.captureControl == RecorderBase.CaptureControl.FrameRange) | ||
{ | ||
EditorGUILayout.PropertyField(so.FindProperty("m_startFrame")); | ||
EditorGUILayout.PropertyField(so.FindProperty("m_endFrame")); | ||
} | ||
else if (recorder.captureControl == RecorderBase.CaptureControl.TimeRange) | ||
{ | ||
EditorGUILayout.PropertyField(so.FindProperty("m_startTime")); | ||
EditorGUILayout.PropertyField(so.FindProperty("m_endTime")); | ||
} | ||
|
||
if (recorder.captureControl == RecorderBase.CaptureControl.FrameRange || | ||
recorder.captureControl == RecorderBase.CaptureControl.TimeRange) | ||
{ | ||
if (!EditorApplication.isPlaying) | ||
{ | ||
EditorGUILayout.Space(); | ||
if (GUILayout.Button("Play")) | ||
{ | ||
EditorApplication.isPlaying = true; | ||
} | ||
} | ||
else if (recorder.isRecording) | ||
{ | ||
if (GUILayout.Button("Abort")) | ||
{ | ||
recorder.EndRecording(); | ||
} | ||
} | ||
} | ||
else if (recorder.captureControl == RecorderBase.CaptureControl.Manual) | ||
{ | ||
EditorGUILayout.Space(); | ||
if (!recorder.isRecording) | ||
{ | ||
if (GUILayout.Button("Start Recording")) | ||
{ | ||
if (!EditorApplication.isPlaying) | ||
{ | ||
recorder.recordOnStart = true; | ||
EditorApplication.isPlaying = true; | ||
} | ||
else | ||
{ | ||
recorder.BeginRecording(); | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
if (GUILayout.Button("End Recording")) | ||
{ | ||
recorder.EndRecording(); | ||
} | ||
} | ||
} | ||
EditorGUI.indentLevel--; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
FrameCapturer/Assets/UTJ/FrameCapturer/Editor/RecorderBaseEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.