public bool OnInputGui(ref RecorderInputSetting input) { var index = input.GetType() == typeof(CBRenderTextureInputSettings) ? 0 : input.GetType() == typeof(RenderTextureSamplerSettings) ? 1 : 2; var newIndex = EditorGUILayout.Popup("Collection method", index, candidates); if (index != newIndex) { switch (newIndex) { case 0: input = recSettings.NewInputSettingsObj <CBRenderTextureInputSettings>(title); break; case 1: input = recSettings.NewInputSettingsObj <RenderTextureSamplerSettings>(title); break; case 2: input = recSettings.NewInputSettingsObj <RenderTextureInputSettings>(title); break; } return(true); } return(false); }
public bool OnInputGui(int groupIndex, ref RecorderInputSetting input) { if (!m_Groups.ContainsKey(groupIndex)) { return(false); } if (m_Groups[groupIndex].types.Length < 2) { return(false); } int index = 0; for (int i = 0; i < m_Groups[groupIndex].types.Length; i++) { if (m_Groups[groupIndex].types[i] == input.GetType()) { index = i; break; } } var newIndex = EditorGUILayout.Popup("Collection method", index, m_Groups[groupIndex].captions); if (index != newIndex) { input = recSettings.NewInputSettingsObj(m_Groups[groupIndex].types[newIndex], m_Groups[groupIndex].title); return(true); } return(false); }