void SetVisibleSketchSet(SketchSetType type) { if (m_CurrentSketchSet != type) { // Clean up our old sketch set. if (m_SketchSet != null) { m_SketchSet.OnChanged -= OnSketchSetDirty; } // Cache new set. m_SketchSet = SketchCatalog.m_Instance.GetSet(type); m_SketchSet.OnChanged += OnSketchSetDirty; m_SketchSet.RequestRefresh(); // Tell all the icons which set to reference when loading sketches. IEnumerable <LoadSketchButton> allIcons = m_IconsOnFirstPage.Concat(m_IconsOnNormalPage) .Select(icon => icon.GetComponent <LoadSketchButton>()) .Where(icon => icon != null); foreach (LoadSketchButton icon in allIcons) { icon.SketchSet = m_SketchSet; } ComputeNumPages(); ResetPageIndex(); m_CurrentSketchSet = type; RefreshPage(); switch (m_CurrentSketchSet) { case SketchSetType.User: if (m_PanelText) { m_PanelText.text = m_PanelTextStandard; } if (m_PanelTextPro) { m_PanelTextPro.text = m_PanelTextStandard; } break; case SketchSetType.Curated: if (m_PanelText) { m_PanelText.text = m_PanelTextShowcase; } if (m_PanelTextPro) { m_PanelTextPro.text = m_PanelTextShowcase; } break; case SketchSetType.Liked: if (m_PanelText) { m_PanelText.text = m_PanelTextLiked; } if (m_PanelTextPro) { m_PanelTextPro.text = m_PanelTextLiked; } break; case SketchSetType.Drive: if (m_PanelText) { m_PanelText.text = m_PanelTextDrive; } if (m_PanelTextPro) { m_PanelTextPro.text = m_PanelTextDrive; } break; } } }