public override void OnInspectorGUI() { DrawingVisualizerWithSettings <TMessageType, TVisualizerSettings> visualizer = (DrawingVisualizerWithSettings <TMessageType, TVisualizerSettings>)target; visualizer.Topic = EditorGUILayout.TextField("Topic", visualizer.Topic); m_Config = visualizer.Settings; m_Config = (TVisualizerSettings)EditorGUILayout.ObjectField("Visualizer settings", m_Config, typeof(TVisualizerSettings), false); visualizer.Settings = m_Config; if (GUI.changed) { EditorUtility.SetDirty(target); if (visualizer.gameObject.scene != null) { UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(visualizer.gameObject.scene); } GUI.changed = false; } EditorGUI.indentLevel++; OnInspectorGUIForSettings(visualizer); EditorGUI.indentLevel--; if (GUI.changed) { visualizer.Redraw(); } }
public void VisualizerRedraw() { DrawingVisualizerWithSettings <TMessageType, TVisualizerSettings> visualizer = (DrawingVisualizerWithSettings <TMessageType, TVisualizerSettings>)target; visualizer.Redraw(); }