public void LoadSaveState(SaveState save) { if (m_TopicState.ServiceResponseTopic != null && save.Subtopic == MessageSubtopic.Response) { // this save actually applies to the response topic m_ServiceResponseTopic.LoadSaveState(save); return; } if (save.HasRect && save.Rect.width > 0 && save.Rect.height > 0) { m_VisualWindow = new HudWindow(Title, save.Rect); } else if (save.ShowWindow) { m_VisualWindow = new HudWindow(Title); } if (m_VisualWindow != null) { HudPanel.AddWindow(m_VisualWindow); } SetVisualizing(save.ShowWindow, save.ShowDrawing); }
public void SetVisualizing(bool ui, bool drawing) { m_IsVisualizingUI = ui; m_IsVisualizingDrawing = drawing; if (m_VisualWindow != null) { m_VisualWindow.SetActive(ui); } else if (ui) { m_VisualWindow = new HudWindow(Title); HudPanel.AddWindow(m_VisualWindow); } if ((ui || drawing) && m_Visual == null) { m_Visual = GetVisualFactory().GetOrCreateVisual(Topic); } if (m_Visual != null) { m_Visual.SetDrawingEnabled(drawing); if (m_VisualWindow != null) { m_VisualWindow.SetOnGUI(m_Visual.OnGUI); } } }