protected virtual void OnFrameRateGui() { AddProperty(m_FrameRateMode, () => EditorGUILayout.PropertyField(m_FrameRateMode, new GUIContent("Constraint Type"))); AddProperty(m_FrameRateExact, () => { using (var check = new EditorGUI.ChangeCheckScope()) { var label = m_FrameRateMode.intValue == (int)FrameRateMode.Constant ? "Target fps" : "Max fps"; var index = EnumHelper.GetMaskedIndexFromEnumValue <EFrameRate>(m_FrameRateExact.intValue, 0xFFFF); index = EditorGUILayout.Popup(label, index, m_FrameRateLabels); if (check.changed) { m_FrameRateExact.intValue = EnumHelper.GetEnumValueFromMaskedIndex <EFrameRate>(index, 0xFFFF); if (m_FrameRateExact.intValue != (int)EFrameRate.FR_CUSTOM) { m_FrameRate.floatValue = FrameRateHelper.ToFloat((EFrameRate)m_FrameRateExact.intValue, m_FrameRate.floatValue); } } } }); AddProperty(m_FrameRate, () => { if (m_FrameRateExact.intValue == (int)EFrameRate.FR_CUSTOM) { ++EditorGUI.indentLevel; EditorGUILayout.PropertyField(m_FrameRate, new GUIContent("Value")); --EditorGUI.indentLevel; } }); AddProperty(m_FrameRateMode, () => { if (m_FrameRateMode.intValue == (int)FrameRateMode.Constant) { EditorGUILayout.PropertyField(m_SynchFrameRate, new GUIContent("Sync. framerate")); } }); }
protected virtual void OnEnable() { if (target != null) { m_InputEditors = new List <InputEditorState>(); m_FrameRateLabels = EnumHelper.MaskOutEnumNames <EFrameRate>(0xFFFF, (x) => FrameRateHelper.ToLable((EFrameRate)x)); var pf = new PropertyFinder <RecorderSettings>(serializedObject); m_FrameRateMode = pf.Find(x => x.m_FrameRateMode); m_FrameRate = pf.Find(x => x.m_FrameRate); m_DurationMode = pf.Find(x => x.m_DurationMode); m_StartFrame = pf.Find(x => x.m_StartFrame); m_EndFrame = pf.Find(x => x.m_EndFrame); m_StartTime = pf.Find(x => x.m_StartTime); m_EndTime = pf.Find(x => x.m_EndTime); m_SynchFrameRate = pf.Find(x => x.m_SynchFrameRate); m_CaptureEveryNthFrame = pf.Find(x => x.m_CaptureEveryNthFrame); m_FrameRateExact = pf.Find(x => x.m_FrameRateExact); m_DestinationPath = pf.Find(w => w.m_DestinationPath); m_BaseFileName = pf.Find(w => w.m_BaseFileName); BuildInputEditors(); } }