void DrawScreenshot() { GUILayout.Space(5); RenderMonsterEditorGUIHelper.Header("Screenshot", Color.white); using (new AmazingAssets.EditorGUIUtility.EditorGUIIndentLevel(1)) { EditorGUILayout.LabelField("Hotkey"); Rect drawRect = GUILayoutUtility.GetLastRect(); if (GUI.Button(new Rect(drawRect.xMin + UnityEditor.EditorGUIUtility.labelWidth, drawRect.yMin, drawRect.width - UnityEditor.EditorGUIUtility.labelWidth - 54, drawRect.height), _target.screenshotHotkey.ToString(), EditorStyles.popup)) { RenderMonsterKeyCodeWindow.ShowWindow(GUIUtility.GUIToScreenPoint(new Vector2(drawRect.xMin, drawRect.yMax + 2)), UpdateScreenshotKeyCode); } drawRect = EditorGUILayout.GetControlRect(); if (GUI.Button(new Rect(drawRect.xMax - 50, drawRect.yMin - 18, 50, 33), new GUIContent(icon_screenshot, "Screenshot"))) { _target.CaptureScreenshot(); PlayShutterSound(); } } }
void DrawImageSequence() { GUILayout.Space(5); RenderMonsterEditorGUIHelper.Header("Image Sequence", Color.white); Rect drawRect; drawRect = GUILayoutUtility.GetLastRect(); using (new AmazingAssets.EditorGUIUtility.EditorGUIIndentLevel(1)) { using (new AmazingAssets.EditorGUIUtility.GUILayoutBeginHorizontal()) { EditorGUILayout.PropertyField(beginRecordingMode, new GUIContent("Begin Recording")); EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(50)); } using (new AmazingAssets.EditorGUIUtility.GUILayoutBeginHorizontal()) { EditorGUILayout.PropertyField(stopRecordingMode, new GUIContent("Stop Recording")); EditorGUILayout.LabelField(" ", GUILayout.MaxWidth(50)); } drawRect = GUILayoutUtility.GetLastRect(); using (new AmazingAssets.EditorGUIUtility.GUIEnabled(Application.isPlaying ? true : false)) { using (new AmazingAssets.EditorGUIUtility.GUIBackgroundColor(_target.IsRecording() ? Color.red : Color.white)) { if (GUI.Button(new Rect(drawRect.xMax - 50, drawRect.yMin - 18, 50, 33), _target.IsRecording() ? iconPlayOn : iconPlayOff)) { if (_target.IsRecording()) { _target.StopRecording(); } else { _target.BeginRecording(); } } } } if ((beginRecordingMode.enumValueIndex == (int)RenderMonster.BEGIN_RECORDING.ByHotkey || stopRecordingMode.enumValueIndex == (int)RenderMonster.STOP_RECORDING.ByHotkey)) { EditorGUILayout.LabelField("Hotkey"); drawRect = GUILayoutUtility.GetLastRect(); drawRect.xMin += UnityEditor.EditorGUIUtility.labelWidth; if (GUI.Button(drawRect, _target.recordingHotkey.ToString(), EditorStyles.popup)) { RenderMonsterKeyCodeWindow.ShowWindow(GUIUtility.GUIToScreenPoint(new Vector2(drawRect.xMin, drawRect.yMax + 2)), UpdatePauseResumeKeyCode); } } if (stopRecordingMode.enumValueIndex == (int)RenderMonster.STOP_RECORDING.AfterNFrame) { EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(nFrame); if (EditorGUI.EndChangeCheck()) { if (nFrame.intValue < 1) { nFrame.intValue = 1; } } } if (stopRecordingMode.enumValueIndex == (int)RenderMonster.STOP_RECORDING.AfterNSec) { EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(nSec); if (EditorGUI.EndChangeCheck()) { if (nSec.intValue < 1) { nSec.intValue = 1; } } } EditorGUILayout.LabelField("FPS"); drawRect = GUILayoutUtility.GetLastRect(); drawRect.xMax -= 54; EditorGUI.BeginChangeCheck(); fPS.intValue = EditorGUI.IntField(drawRect, " ", fPS.intValue); if (EditorGUI.EndChangeCheck()) { if (fPS.intValue < 1) { fPS.intValue = 1; } } drawRect.xMin = drawRect.xMax + 4; drawRect.width = 50; if (GUI.Button(drawRect, "...", EditorStyles.popup)) { GenericMenu menu = new GenericMenu(); menu.AddItem(new GUIContent("1"), false, MenuCallback_FrameRate, 1); menu.AddItem(new GUIContent("5"), false, MenuCallback_FrameRate, 5); menu.AddItem(new GUIContent("10"), false, MenuCallback_FrameRate, 10); menu.AddItem(new GUIContent("15"), false, MenuCallback_FrameRate, 15); menu.AddItem(new GUIContent("25"), false, MenuCallback_FrameRate, 25); menu.AddItem(new GUIContent("30"), false, MenuCallback_FrameRate, 30); menu.AddItem(new GUIContent("60"), false, MenuCallback_FrameRate, 60); menu.AddItem(new GUIContent("120"), false, MenuCallback_FrameRate, 120); menu.ShowAsContext(); } } }